htmlfirefoxoffline-cachingapplication-cachemanifest.cache

HTML5 Offline Appcache Updates Not Showing In Firefox


I have an index.php file in my docroot. It produces output that starts with this:

<!DOCTYPE html> 
<html manifest="manifest.appcache">

The manifest.appcache tells browsers to cache it for offline use. Again, the relevant parts:

CACHE MANIFEST

#version 8-25-2011

CACHE:

#internal HTML documents
#this tells the browser to cache the HTML it retrieves from http://example.com/
/

NETWORK:
*

Offline access is working fine with this setup, but updating is not working as I would expect in Firefox.

In Chrome and Safari, when I update the index.php file and then change a comment in the cache.manifest file, the browsers will grab the new index.php output and use that in the cache.

However, in Firefox, it seems to not care that I've updated the manifest.appcache file. I suspect that if I wait long enough, it will update, but I've tried waiting hours.

How can I find and eliminate my caching problem?


Solution

  • What HTTP cache headers are you sending with your index.php file? If you've not set things like the Cache-control: and Expires: headers then Firefox could be refreshing the application cache version of the page from it's regular cache instead of requesting it again from the server.

    EDIT BY POSTER OF THE QUESTION:

    For anyone that wants to know what exactly it took, here's what I put in my .htaccess file based on this answer and a perusal of http://www.diveintohtml5.info/offline.html:

    <Files *.appcache>
        ExpiresActive On
        ExpiresDefault "access"
    </Files>
    

    Hope that helps the next person!