title: How long does Google Chrome cache a resource if expires and/or no-cache headers are not set?
body: <p>We have been having a problem with Chrome caching a resource on our Glassfish server. The expires and no-cache headers are not being sent and the resource (an approximately 4 MB SWF file) is being cached by Chrome -- despite the presence of the Last-Modified header.</p>
  
  <p>Sometimes Chrome will get a 304 code, and other times it simply does a 200 (from cache). I understand the 304 -- Chrome is likely checking the most recent Last-Modified date with the cached version to decide. But other times it does the 200 (from cache), which does not return any header information and appears that Chrome is simply assuming the file hasn't been modified instead of checking. </p>
  
  <p><a href="http://code.google.com/speed/page-speed/docs/caching.html">Google's own site states</a> the following:</p>
  
  <blockquote>
    <p>HTTP/S supports local caching of static resources by the browser. Some
    of the newest browsers (e.g. IE 7, Chrome) use a heuristic to decide
    how long to cache all resources that don't have explicit caching
    headers.</p>
  </blockquote>
  
  <p>But this does not provide a definitive answer. Is this heuristic published anywhere? I realize there may not be a fixed answer (like 30 days), but some general guidelines would be useful. Furthermore, if Last-Modified is being set, I don't understand why Chrome isn't bothering to check that first.</p>