Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off Application Cache with manifest

I'm writing a HTML5 application that uses "Application Cache with manifest".

However, while I'm developing I want to turn it off.

I tried removing the manifest attribute from the tag and switching everything to network in the manifest file.

Although it did update on the first update, all subsequence updates are still read from the cache rather than the server.

I can see that the HTML file has updated and there is no longer a manifest attribute on the tag, yet it still loads from the cache.

I can't seem to figure out how to turn it off once you've set it, so here's my question:

Is there a way to turn off "Application Cache with manifest" in Google Chrome?

like image 494
HM2K Avatar asked Jan 28 '11 11:01

HM2K


People also ask

What does cache do in manifest file?

The cache manifest file is a simple text file that lists the resources the browser should cache for offline access.

Should manifest JSON be cached?

Yes you should cache your manifest. json file, because if you a building a PWA, then it must have a functionality to Add to home screen . In your manifest file, it contains a start_url that needs to be cached by service worker and should return a 200 response when offline.

Is application cache deprecated?

AppCache is documented as deprecated and under removal in MDN and in the WHATWG standard, and marked as obsolete in W3C's HTML 5.1. It is incompatible with CORS, making it unfriendly for usage with CDNs.


1 Answers

In Chrome, go to Under the bonnet -> Content Settings -> Cookies -> Show cookies and other site data, application caches should show up under the site data.

In Firefox go to Advanced -> Network, sites with application caches are listed in a box at the bottom.

There's no way completely to completely remove or expire an application cache from the server side at present. The best you can do is explicitly tell the browser to remove all the cached files - a manifest with just a network section should delete all the other files, but the file with the manifest reference will itself always be cached.

--edit

This answer is no longer entirely correct. Currently the standard states:

If fetching the manifest fails due to a 404 or 410 response or equivalent...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.

That is: deleting the manifest file should cause the appcache to be deleted the next time the browser attempts to update

like image 50
robertc Avatar answered Nov 15 '22 21:11

robertc