6

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?

Raedwald
  • 191
  • 1
  • 11
optixx
  • 216
  • 2
  • 7

1 Answers1

5

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.

optixx
  • 216
  • 2
  • 7