Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Iam serving my static content with ngnix.

location /static {
      alias /opt/static/blog/;
      access_log off;
      etags on;
      etag_hash on;
      etag_hash_method md5;
      expires     1d;
      add_header Pragma "public";
      add_header Cache-Control  "public, must-revalidate, proxy-revalidate";
}

The resulting header looks like this:

Cache-Control:public, must-revalidate, proxy-revalidate
Cache-Control:max-age=86400
Connection:close
Content-Encoding:gzip
Content-Type:application/x-javascript; charset=utf-8
Date:Tue, 11 Sep 2012 08:39:05 GMT
Etag:e2266fb151337fc1996218fafcf3bcee
Expires:Wed, 12 Sep 2012 08:39:05 GMT
Last-Modified:Tue, 11 Sep 2012 06:22:41 GMT
Pragma:public
Server:nginx/1.2.2
Transfer-Encoding:chunked
Vary:Accept-Encoding

Why is nginx sending 2 Cache-Control entries, could this be a problem for the clients?

share|improve this question
    
What is the rest of the detail of your server setup? –  Michael Hampton Sep 11 '12 at 8:53
    
I guess i found my answer: w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 –  optixx Sep 11 '12 at 8:56
add comment

1 Answer

up vote 2 down vote accepted

http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)]. It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded.

share|improve this answer
    
Mark as correct please. –  3molo Sep 11 '12 at 8:59
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.