Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why might cache-manifest fail to get mobile Safari to cache site while working as expected on desktop?

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?

like image 345
S P Avatar asked Oct 13 '22 21:10

S P


1 Answers

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.

like image 159
iPhAnd Avatar answered Oct 25 '22 02:10

iPhAnd