2

I have an application which used to use the HTML5 offline cache. Now I've decided to not use it anymore and removed the manifest attribute from the index.html file. However, browsers still regard this site as cached and refuse to update the index.html file.

Even updating the manifest doesn't help. How can I remove the site from the user's offline caches? Am I stuck with a cached web site forever?

3
  • How have you tried updating the manifest?
    – edeverett
    Apr 6, 2011 at 8:23
  • A user could remove it manually in Preference panel of the browser. Not sure this is the answer you are seeking.
    – timdream
    Apr 6, 2011 at 8:23
  • @edeverett: updating the manifest did not change caching of the main file @timdream: I can't ask the users because I don't know which users are affected. Also where is this preference pane in Chrome? Apr 6, 2011 at 16:49

2 Answers 2

2

You need to make sure the manifest file isn't being cached, which by default it will be.

Adding

ExpiresActive On
ExpiresDefault "access"

To your .htaccess will stop everything being cached, though you really just want the manifest file to be cached in this way like this: (remember to update filename)

<Files cache.manifest>
    ExpiresActive On
    ExpiresDefault "access"
</Files>

You really need to do that first, but this should alleviate the problem.

I'd recommend reading through Mark Pilgrim's page on this as well.

1
  • Changed link to go to the mirror. Oct 5, 2011 at 21:09
0

Try changing contents of your manifest to simply CACHE MANIFEST with no files listed. The clients should retrieve the new manifest next time they hit the site and their cache should be removed.

Note however that they won't be using this new, empty manifest until they refresh the page.

I've found that in some cases on some browsers they don't necessarily grab the new manifest right away. This behavior seems inconsistent though. When this happens I tend to clear their caches / offline storage manually in order to force them to update (though I understand you can't necessarily get users to do this).

1
  • For me this doesn't work for the main file, which contains the manifest= attribute. Somehow the browser still thinks this site is cached. Apr 6, 2011 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.