HTML and CSS Reference
In-Depth Information
Watch out for dodgy foxes!
Firefox boasts support for offline applications, but it doesn't quite work as smoothly as other browsers, and
there are a few important bugs to be aware of. If you're testing with Firefox, make sure you're also check-
ing what's actually being requested from your server by monitoring the server logs. The browser should
always request the manifest on every single visit (or refresh) of your domain. Older versions of Firefox (3.6
and 4) don't re-request the manifest, meaning that you're stuck with the manifest and resources that the
browser downloaded the first time, regardless of any changes you may have made! There is hope! You
can tell the browser never to cache the manifest file by adding the following code to your server config or
.htaccess (or similar) file:
<filesMatch ".appcache$">
Header set Cache-Control "max-age=0, private, no-store, no-cache,
¬ must-revalidate"
</filesMatch>
If you're using mod_expires for Apache, you need to include the following in your httpd.conf:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/cache-manifest “access plus 0 seconds”
</IfModule>
Yo u a l s o s e n d c u s t o m h e a d e r s o n r e q u e s t s f o r . a p p c a c h e i l e s a n d s e n d a no-cache header:
Header set Pragma “no-cache”
I will caveat this whole sidebar with the simple fact that Firefox upgrades are moving faster than, well,
a fox that's on fire. It's quite possible that by the time you read this, we'll have Firefox 13 and it won't be
an issue. It's also quite possible that when this topic is released, Firefox's latest release won't have this
issue—but this no-cache rule won't do any harm—so go ahead and plug it in.
When you visit a web page that makes use of the cache mani-
fest, such as my time example, here is what happens:
1.
Browser: requests http://introducinghtml5.com/examples/
ch07/time/
Server: returns index.html
2.
3.
Browser: parses index.html and requests all the assets in
the page, images, CSS, JS, and the manifest file
4.
Server: returns all requested assets
5.
Browser: processes the manifest and requests all the items
in the manifest, regardless of whether it's just requested
them. This could effectively be a double request for your
application if you're caching all the assets
6.
Server: returns the requested manifest assets
 
Search WWH ::




Custom Search