Why isn't Safari caching mp4 files?

2019-05-30 15:01发布

问题:

Safari does not seem to be able to cache mp4 files. I am using web inspector on Safari 8.0 desktop and iOS 7 and 8 iPad and mp4 files of any size (I tried as small as .75MB do not seem to ever make it into the http cache.

Furthermore, which I select the mp4 resource in the web inspector I see a spinner that never completes and am unable to see the request and response headers.

Can someone prove me wrong and show me an example of an mp4 caching in Safari?

Here are the headers I see when using Chrome (which does cache the mp4):

General
.   .Remote Address:23.61.194.193:80
.   Request URL:redacted
.   Request Method:GET
.   Status Code:206 Partial Content (from cache)
Response Headers
.   Accept-Ranges:bytes
.   Cache-Control:public, max-age=157769585
.   Content-Length:5377503
.   Content-MD5:YhxzzDFHeg9ydilu7eR+SQ==
.   Content-Range:bytes 22353-5399855/5399856
.   Content-Type:video/mp4
.   Date:Thu, 16 Apr 2015 19:06:55 GMT
.   Expires:Wed, 15 Apr 2020 20:00:00 GMT
.   Last-Modified:Tue, 12 Aug 2014 17:09:32 GMT
.   Server:Apache
Request Headers
.   Provisional headers are shown
.   Accept-Encoding:identity;q=1, *;q=0
.   Range:bytes=22353-
.   Referer:http://tenfootui.netflix.com/users/jamunning/cacheTest.html#
.   User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
.   
.