Why might cache-manifest fail to get mobile Safari

2019-05-01 16:55发布

I'm playing around with a simple web app locally, and can't quite figure out why it is not caching correctly on the iPhone. I am serving a .manifest file with the correct MIME-type, and the site works perfectly fine with my local server turned on or off on desktop Safari, Chrome and Firefox. It is only mobile Safari that is failing to cache the site. Any ideas why this might be?

3条回答
2楼-- · 2019-05-01 17:44

I can confirm that the bug is also present on iPAD running iOS 4.3.

I spent quite some time to make the offline application cache work on iPad. I can confirm that the workaround mentioned in the previous post works.

查看更多
贪生不怕死
3楼-- · 2019-05-01 17:48

I had a similar issue but Safari and iPhone were both NOT working whilst IE and Firefox were working. The reason was complex. One was a misspelling of the word "manifest" in the HTML tag. Silly mistake and very frustrating that IE and FF still worked offline. The other issue was that I was using default.asp as the main page of my app and not including this in the manifest.

My app was mydomain.com/myapp/ and thus the browser never saw the "default.asp". Also, according to the HTML5 spec, the main page need not be in the manifest but apparently Safari sees that a little differently...

查看更多
唯我独甜
4楼-- · 2019-05-01 17:55

It seems to be an iOS bug.

I found out that mobile safari will always run into an application caching error if you have at least one web view opened and the you clear the browser cache. I think that clearing the browser cache will destroy the cache database. All accesses to the cache database will then fail. It seems that the browser creates this database only on startup.

To get the application cache working again close all safari views and finally close the browser by returning to the home screen. Now applicaton caching should working. Some mobile devices also requires switching on and off.

If you know a methode to detect this situation let me know it, please.

查看更多
登录 后发表回答