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 am trying to add a expires header to the nginx configuration like this :

    location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff|\.pdf|\.ico$ 
        expires max;
        add_header Cache-Control "public";

What is expected :
I shouldn't see any line in the network tab of developer console of chrome or firebug for the static content.

But I find that the browser re-requesting the headers always with every request, no matter how you send it. ( with either f5 or loading the link through new tab ) and it comes back with a 304 response code.

Any idea how to make the browser understand that it is not supposed to ask till year 2037??

edit : response/request headers :

Response headers :
Request URL:
Request Method:GET
Status Code:304 Not Modified
Request Headersview source

Request headers :
If-Modified-Since:Mon, 18 Jul 2011 08:46:58 GMT
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.821.0 Chrome/14.0.821.0 Safari/535.1

share|improve this question
Show the response headers .. or better: Would be good to have an online URL to double check – LazyOne Jul 18 '11 at 10:41
Now clear your local browser cache and try again. – symcbean Jul 18 '11 at 12:30
:( No, deleting the cache didn't solve it... – Shrinath Jul 19 '11 at 5:05

Your Answer


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

Browse other questions tagged or ask your own question.