Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using rails with nginx/passenger.

If I set up the expire http header of a css file to 1 year, if I modify that file, will it be ignored by the browser (ie, it will not request the new version)?

Given that Rails adds a different timestamps to each asset such as foo.css?1270165626 every time I restart the server?

That's the config I use right now (nginx/passenger):

    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
            expires max;
share|improve this question
Yes that would be an issue, I would recommend taking that feature off if possible. Wordpress does the same thing, it bugs me cuzz I can't get rid of them! – Kyle Apr 2 '10 at 2:51

It would ignore it until the file name changes. So if the file name only changes when you restart your webserver then you'd have to restart it for any changes to apply.

share|improve this answer

Your Answer


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