I setup an Application Cache on a site and shortly thereafter realized its way more aggressive that I realized. I want to remove it. Permanently.
I've read that passing a changed manifest file, completely empty, with the correct MIMETYPE will remove the cache. Edit: See below. Maurice's answer is the only consistent fix.
Is this the fastest, most effective solution? Is there a better way?
And if you can specify whether or not you've actually used this functionality before with your answer I'd really appreciate it - ambiguous documentation and quirky that didn't show during testing are what got me into this situation.
The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users.
If there is no updated version of the manifest file on the server, then noupdate is fired. If the browser is downloading the cache for the first time, or if is downloading an updated cache, then this is fired. This is fired for each and every file which is downloaded as part of the AppCache.
The Application Cache (AppCache) API allows offline access to your application by providing the following benefits: Performance - Specified site resources come right from disk, avoiding any network trips. Availability - Users can navigate to your site when they are offline.
The trick is to first change the manifest URL in your HTML page to something invalid so the browser will receive a 404 when loading it. Make sure to also change the original manifest otherwise the new HTML page is never downloaded. After the browser has failed to download the new manifest URL you can completely remove the manifest setting from the HTML page.
Kind of wacky but that seems to be the only reliable way of removing an existing manifest reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With