Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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"
</FilesMatch>

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
share|improve this question
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.