I have set up a very long expiry on some files in my .htaccess (this is OK as I change the actual filename whenever its content changes).

<FilesMatch "min_\d+-\d+-\d+-\d+-\d+-\d+\.css$|min_\d+-\d+-\d+-\d+-\d+-\d+\.js$">
Header set Cache-Control "max-age=31536000, public"

Looking at the output of Firebug, the cache-control is getting passed through, but I notice that the 'Expires' in the response is set to 25th May (14 days in the future rather than 1 year as it aught to be). Does anyone have any ideas what is going on?

Request Headers

Accept          text/css,*/*;q=0.1
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Connection      keep-alive
Host            redacted.co.uk
Referer         http://redacted.co.uk/hh/main_minimised/
User-Agent      Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0

Response Headers

Accept-Ranges       none
Cache-Control       max-age=31536000, public
Connection          Keep-Alive
Content-Encoding    gzip
Content-Length      5576
Content-Type        text/css
Date                Sat, 11 May 2013 22:46:47 GMT
Expires             Sat, 25 May 2013 22:46:47 GMT
Keep-Alive          timeout=5, max=99
Last-Modified       Sat, 11 May 2013 17:12:31 GMT
Server              Apache
Vary                Accept-Encoding
  • Cache-Control and Expires are separate headers. Do you have something else setting the Expires header? – Tim Fountain May 11 '13 at 23:07
  • @Tim Fountain thansk for the explanation. It was another .htcaccess in the root that was causing this to get set. – spiderplant0 May 12 '13 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.