title: Nginx/PHP : Nginx is not returning a 304 response when sending Etag header
body: <p>I'm trying the understand local cache with ETags and a nginx (1.2.1) server which redirects php's request to a php-cgi deamon.</p>
  
  <p>Here my simple index.php :</p>
  
  <pre><code>&lt;?php
  header('Cache-Control: public');
  header('Etag:"5954c6-10f4-449d11713aac0"');
  
  echo microtime(true);
  </code></pre>
  
  <p>After a second request, my browser send a If-None-Match header :</p>
  
  <pre><code>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
  Cache-Control:max-age=0
  Connection:keep-alive
  Host:cache.loc
  If-None-Match:"5954c6-10f4-449d11713aac0"
  </code></pre>
  
  <p>But my web server doesn't returns a 304 :</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server: nginx/1.2.2
  Date: Thu, 12 Jul 2012 11:46:03 GMT
  Content-Type: text/html
  Transfer-Encoding: chunked
  Connection: keep-alive
  X-Powered-By: PHP/5.3.12
  Cache-Control: public
  Etag: "5954c6-10f4-449d11713aac0"
  Cache-Control: public
  </code></pre>
  
  <p>Unless I've misunderstood, my server should compare Etag with the If-None-Match sent and returns a 304 response because they're the same.</p>
  
  <p>Where am I wrong ?
  Should I compare Etag with If-None-Match in my PHP script because nginx (or Apache) will not do the job itself ?</p>
  
  <p>Regards,
  Manu</p>