I have a web app developed with application cache. I am testing it on Windows Phone 8.1 running IE 11 mobile. When the internet connection is turned off the web app loads as expected. My problem is that if I hit the refresh button on the browser when the web app is in offline mode the browser tries to check for an updated manifest file. Since there is no connection it cannot find it and then the cache is rendered in an obsolete state and the browser invalidates the cache. The browser refreshes the web app and then tries to pull the page from the network which fails since I am offline. To summarize, what can I do to prevent the browser from invalidating the application cache on refresh when running in offline mode?
3 Answers
That sounds like a bug to me. Per spec, the applicationCache should only be invalidated (become obsolete) if the request to the *.appcache file returns a 404 or a 410 status. If you are offline, it should instead fail with a status of 0.
I'd suggest to test it with other browsers devices and eventually report it as bug to the IE11 team
Comments
Not an answer but my reputation isn't high enough to comment, sorry.
Other people have noticed this too (Why offline web application doesn't work?), so as mentioned already here, it looks like a bug.
Are you testing in the 8.1 release that is available from the Developer Preview app? Or a phone running an official release of 8.1?
Comments
I ran into the same problem. I haven't got a solution yet. But i want to list what did NOT work!
- Adding IIS Mime Types, as discussed here
- Changing .manifest to .appcache, as discussed here
- Adding the meta header "cache-control: public" as described here
- Also did not work to add the header manually in the webbrowser control of the wp 8.1 cordova web app (in the navigate method).
- Deleting the Browser History and local storage in windows phone setting is making the problem even worser
- Strangely using developer options in IE and change under the tab emulation to windows phone, the appcache loads succesfull
I hope this list will help other people not to find other solutions.