Why is Chrome still caching this request?

I have a page with all the cache management settings, and yet Google Chrome continues to pull it out of the cache. We emptied the entire navigation history, but after one reboot, Chrome caches it again:

Request URL:http://stuf.com/path/to/foo
Request Method:GET
Status Code:200 OK (from cache)
Response Headers
Accept-Ranges:bytes
Age:0
Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Content-Encoding:gzip
Content-Language:fr
Content-Length:7289
Content-Type:text/html; charset=utf-8
Date:Fri, 17 Jul 2015 23:19:54 GMT
Expires:Fri, 01 Jan 2010 00:00:00 GMT
Server:nginx
Vary:Accept-Language, Cookie, Accept-Encoding
Via:1.1 varnish
X-Varnish:1867509088
X-Varnish-Cache:MISS
Request Headers
Provisional headers are shown
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

We have a varnish setting, but as you can see from X-Varnish-Cache, this is a miss. In addition, the status code section indicates that Chrome uses the cache.

+4
source share
1 answer

In the response header, Chrome indicates that age is 0, i.e. the response was cached for a second or less.

It should work if you wait more than a second or enable the validator : a ETag Last-Modified, ( ) GET.

, must-revalidate ( max-age=0):

must-revalidate , , , , .

ETag Last-Modified .

, Expires:

Expires max-age, max-age Expires, Expires . HTTP/1.1 ( ), HTTP/1.0.

RFC.

+2

Source: https://habr.com/ru/post/1598463/


All Articles