It seems that once you have a manifest entry, a la:
<html manifest="cache.manifest">
Then that page (the master entry in the cache) will always be cached (at least by Safari) until the user does something to remove the cache, even if you later remove the manifest attribute from the html tag and update the manifest (by changing something within it), forcing the master entry to be reloaded along with everything else.
In other words, if you have:
-- removing the manifest entry from index.html and modifying the manifest (so it gets expired by the browser and all content reloaded) will not stop this page from behaving as if it's still fully cached. If you view source on index.html you won't see the manifest listed anymore, but the browser will still request only the cache.manifest file, and unless that file's content is changed, no other changes to any files will be shown to the user.
It seems like a pretty glaring bug, and it's present on iOS as well as Mac versions of Safari. Has anyone found a way of resetting the page and getting rid of the cache without requiring user intervention?
Ive been researching the same question, and it doesnt appear to be an api to:
Here are the best resources I have found:
http://www.html5rocks.com/tutorials/appcache/beginner/
http://www.thecssninja.com/javascript/how-to-create-offline-webapps-on-the-iphone
In particular, this quote from the first link:
If the manifest file or a resource specified in it fails to download, the entire update fails. The browser will continue to use the old application cache in the event of such a failure.
Otherwise, there is no mention anywhere about unloading the cache.
Seems to suggest that you cant force an error to get it to uncache. However, as noted below, the spec suggests that if an error occurs while downloading the manifest file, the entire cache will be removed.
In google chrome, the user can go to the following URL:
And manually disable the cache. Of course, the next time they visit the page, it will be recached if the page has the manifest property set.
If you look at the specification:5.6 Offline Web applications
It seems to suggest a situation where the cache is removed. Specifically, section 5.6.4.5:
If fetching the manifest fails due to a 404 or 410 response or equivalent, then run these substeps: Mark cache group as obsolete. This cache group no longer exists for any purpose other than the processing of Document objects already associated with an application cache in the cache group. If cache group has an application cache whose completeness flag is incomplete, then discard that application cache.
It then says:
If this was a cache attempt, discard cache group altogether.
Basically, if the request for the cache manifest file results in a 404, then the entire cache should be discarded. So, have you tried to have the server return a 404 or 410 when the cache manifest file is requested? That should work. The trick is to only return the 404 / 410 for the pages you want to remove the manifest from (perhaps using url parameters?).