Forum Moderators: phranque
I've enabled mod_expire and - just for test purposes - added this to my vhost config, inside the <Directory></Directory> directives:
ExpiresDefault "access 6 months"
It seems to be working. If I request a .js file in my browser and look at the headers sent back:
Cache-control:max-age=1555200
Expires: Sat 06 Dec 2008 00:29:51 GMT
, but if I refresh the page and look at my Apache access_log, I see my browser issuing another GET request for the .js file. So clearly it isn't being cached.
I've tried this in Firefox and Konqueror. In the former, I double checked by browser settings (caching enabled, increase the size of the disk cache).
Am I missing something stupid here? Is it a case that cache-control/expires are only used by intermediate web proxies like squid, and not by browsers? I realise that I can't force a browser to cache content, but it seems strange that FF isn't caching despite my encouragement
Also, look to make sure that there are not multiple cache-control headers, one with a "no-store" and/or "must-revalidate" directive.
A very good tool for this kind of testing is the "Live HTTP Headers" add-on for Firefox/Mozilla browsers.
Jim