title: Automatically expire NSURLCache with max-age=0
body: <p>I am using <code>NSURLCache</code> with <code>AFNetworking</code>. Caching works fine but there is no way to check if a response was actually retrieved from cache.
  To check if a cached version is available, I use </p>
  
  <pre><code>[[NSURLCache sharedURLCache] cachedResponseForRequest:_request];
  </code></pre>
  
  <p>to check for a cached version of my file.</p>
  
  <p>My server is sending the following headers:</p>
  
  <pre><code>Cache-Control:public, must-revalidate, max-age=0
  ETag:"317a405bf9f69346c1f0438736a3d02e"
  </code></pre>
  
  <p>This should basically make sure that the cached response is stale immediately after download.
  However, <code>cachedResponseForRequest:</code> still loads the previously cached version on disk, even if it actually is expired.</p>
  
  <ul>
  <li>Does <code>NSURLCache</code> never expire or am I not sending the correct headers, etc?</li>
  <li>Am I missing something else here?</li>
  </ul>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have also tried to send</p>
  
  <pre><code>Expires: "Mon, 27 May 2013 14:34:50 GMT"
  </code></pre>
  
  <p>header and the response is still returned from the cache, even if it already expired.
  I get the feeling that <code>NSURLCache</code> is not working correctly...</p>