Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing HTML5 Appcache Manifest, Permanently

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.

like image 817
Jason Goldstein Avatar asked Jan 11 '12 06:01

Jason Goldstein


People also ask

What is the purpose of AppCache API in html5?

The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users.

Which event is fired by the AppCache object when the cache download is complete?

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.

What is AppCache API?

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.


1 Answers

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.

like image 192
Maurice Avatar answered Sep 21 '22 14:09

Maurice