I have a client whose site's index.html currently comes back with these headers:
Accept-Ranges: bytes Connection: Keep-Alive Content-Encoding: gzip Content-Length: 3658 Content-Type: text/html Date: Thu, 10 Oct 2013 07:36:27 GMT ETag: "4aa95e1-2ed2-4e721324728b7" Keep-Alive: timeout=5, max=100 Last-Modified: Tue, 24 Sep 2013 13:34:30 GMT Server: Apache/2.2.22 Vary: Accept-Encoding,User-Agent
I'm obviously going to recommend that they add Expires
or Cache-Control
as appropriate, but I'm confused: Chrome caches this resource and uses it from cache (not sending a request at all), even after several hours (for instance, it reused a copy it cached yesterday at 1:30 p.m. this morning at 8:30 a.m.). I can see this quite clearly in the Chrome console's Network tab, where it shows the request and has 200 (OK)
in grey in the Status column and (from cache)
in the Size column. (I haven't changed Chrome's caching defaults.)
I realize that the spec allows user agents to make their own decision in the absense of direction from the headers. Is that what's happening here? Chrome sees it was last modified several days ago and feels free to use a version that's (say) up to a day out of date? Or is there something I'm missing?