Why is Chrome still caching this request? -


i have page cache control goodies set, , yet, google chrome keeps pulling cache. emptied navigation history after 1 reload, chrome caches 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 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, gecko) chrome/43.0.2357.134 safari/537.36 

we have varnish setup, can see x-varnish-cache, it's miss. plus, status code section state chrome using cache.

in response header, chrome states age 0, i.e. response has been cached second or less.

it should work if wait more second or include cache validator: an etag or last-modified header allows browser trigger revalidation (conditional request) instead of normal request.

the problem must-revalidate (which not need max-age=0):

when must-revalidate directive present in response received cache, cache must not use entry after becomes stale respond subsequent request without first revalidating origin server

without , etag or last-modified header revalidation not possible.

also, can skip expires header:

if response includes both expires header , max-age directive, max-age directive overrides expires header, if expires header more restrictive. rule allows origin server provide, given response, longer expiration time http/1.1 (or later) cache http/1.0 cache.

from rfc.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -