title: nginx ETag invalidation
body: <p>I'm caching static resources using the following code in my <code>nginx.conf</code>:</p>
  
  <pre><code>http {
      ...
      gzip on;
      gzip_types *;
      gzip_vary on;
      ...
      server {
          ...
          location /static {
              alias /opt/static_root;
              expires max;
          }
      }
  }
  </code></pre>
  
  <p>This is sufficient to set the following http headers:</p>
  
  <pre><code>$ curl -I example.com/static/css/bootstrap.min.css
  Content-Length: 97874
  Last-Modified: Mon, 21 Nov 2016 18:30:33 GMT
  ETag: "58333d49-17e52"
  Expires: Thu, 31 Dec 2037 23:55:55 GMT
  Cache-Control: max-age=315360000
  </code></pre>
  
  <p>However, even though the <code>Last-Modified</code> date is later than the cached version the browser has, I'm still seeing the old version of the file (tested on Firefox 50.0 and Chrome  54.0.2840.98).</p>
  
  <p>How can I invalidate the ETag so that whenever I deploy diffs to my static files, the browser understands to reload them?</p>
  
  <p>I have tried <code>nginx -s reload</code>, to no avail.</p>