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
Content-Type:application/x-javascript; charset=utf-8
Date:Tue, 11 Sep 2012 08:39:05 GMT
Expires:Wed, 12 Sep 2012 08:39:05 GMT
Last-Modified:Tue, 11 Sep 2012 06:22:41 GMT

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



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.

  • Mark as correct please. – 3molo Sep 11 '12 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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