title: mod_cache + ETag: Apache does not reply 304 to client
body: <p>I have a problem with mod_cache and ETags. Here's my scenario:</p>
  
  <p>Environment: Firefox, Apache 2.2.22 (Mac OSX default), any Web App, Apache is a proxy to the Web App</p>
  
  <p>Initial State:</p>
  
  <ul>
  <li>Browser has an (expired) cache version of doc /aaa, ETag=123</li>
  <li>Apache  has an (expired) cache version of doc /aaa, ETag=123</li>
  </ul>
  
  <p>Scenario:</p>
  
  <ul>
  <li>Browser requests /aaa, If-None-Match: 123</li>
  <li>Apache requests /aaa, If-none-Match: 123 from Web App</li>
  <li>Web App returns 304</li>
  <li><strong>Apache returns his cached version to the Browser (200)</strong></li>
  </ul>
  
  <p>Shouldn't Apache return 304 to the Browser?</p>
  
  <p>Additional Info:</p>
  
  <ul>
  <li>if Apache has no cached version of /aaa, he forwards the ETag to Web App, get 304, and returns 304 to the Browser</li>
  <li>working with Last-Modified/If-Modified-Since instead of ETags works (after getting 304 from the Web App, Apache returns 304 to the Browser)</li>
  </ul>
  
  <p><strong>A much simpler scenario:</strong></p>
  
  <ul>
  <li>Apache version is not expired (ETag: 123) - he doesn't need to get a refresh from Web App</li>
  <li>GET /aaa, If-None-Match: 123</li>
  <li>Response: 200 (instead of 304?)</li>
  </ul>
  
  <p><strong>apache conf</strong></p>
  
  <pre><code>CacheRoot /private/var/log/apache2/cache/
  CacheEnable disk /
  CacheDirLevels 5
  CacheDirLength 3
  CacheIgnoreCacheControl On
  CacheIgnoreHeaders Set-Cookie
  
  &lt;Proxy *&gt;
     Order deny,allow
     Allow from all
  &lt;/Proxy&gt;
  
  ProxyPass / ajp://localhost:8009/ retry=0
  ProxyPassReverse / ajp://localhost:8009/
  ProxyPreserveHost on
  </code></pre>
  
  <p><strong>Request/Response Headers:</strong></p>
  
  <pre><code>GET / HTTP/1.1
  Accept: */*
  If-None-Match: 123456
  
  HTTP/1.1 200 OK
  Date: Tue, 01 Oct 2013 14:01:16 GMT
  ETag: 123456
  Expires: Tue, 01 Oct 2013 14:30:55 GMT
  Cache-Control: max-age=1800
  Content-Language: en-US
  Age: 21
  Content-Length: 20186
  Content-Type: text/html;charset=UTF-8
  </code></pre>