title: Cache-Control headers repeated; valid or not? (Nginx)
body: <p>I've got a resource in my Nginx that is configured like this:</p>
  
  <pre><code>location ~ foo\.js$ {
      add_header Cache-Control public;
      expires 1d;
  }
  </code></pre>
  
  <p>If I open this with Firebug and look at the headers it shows this:</p>
  
  <pre><code>Cache-Control   max-age=86400, public
  </code></pre>
  
  <p>The site is using HTTPS so I want to make sure I get it right because apparently browsers don't cache it unless it's max-age>0 AND <code>public</code>. <a href="http://hoisie.com/post/yes_browsers_do_cache_ssl_resources__so_please_use_googles_cdn" rel="noreferrer">See this</a></p>
  
  <p>But what happens with my Nginx when I use <code>curl -Ik https://...</code> is that it says:</p>
  
  <pre><code>...
  Expires: Sat, 22 Jan 2011 18:23:36 GMT
  Cache-Control: max-age=86400
  Cache-Control: public
  ...
  </code></pre>
  
  <p>It repeats the <code>Cache-Control</code> header! Clearly Firebug doesn't mind. But is it right? </p>
  
  <p>Is there a perhaps a better way to set <code>Expires</code> and <code>Cache-Control</code> (with <code>public</code>) in one just two lines?</p>