Cache-Control: no-cache, must-revalidate, max-age=86400 not honoured when 'continue where left off'/start page set
Reported by
frank.be...@thoughtexchange.com,
Apr 3 2018
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Example URL: https://my.thoughtexchange.com/ Steps to reproduce the problem: 1. Go to above page - note Cache-Control: no-cache, must-revalidate, max-age=86400 2. set Chrome 'on startup' preference to "continue where you left off" or set "https://my.thoughtexchange.com/" as start page. 3. Exit Chrome 4. Start Chrome with --auto-open-devtools-for-tabs so it captures network request early on What is the expected behavior? Network request for top-level html file at https://my.thoughtexchange.com/ What went wrong? No network request for top-level file even though it has cache-control: no-cache, must-revalidate, max-age=86400 Did this work before? No Chrome version: 65.0.3325.181 Channel: stable OS Version: OS X 10.11.6 Flash Version: Most occurrences of version mismatches (where top-level html doesn't match server version) we see are on mobile where "continue where you left off" is generally the behaviour if you force quite the browser and restart. Also broken in Safari. Seems to work in Firefox.
,
Apr 4 2018
This is expected behavior. For forward/back navigations, and when restoring sessions, we load pages with LOAD_SKIP_CACHE_VALIDATION, which will use expired cache entries.
,
Apr 5 2018
@mmenke: As per comment#2 can we close this issue as wont-fix. Please feel free to change the status of the bug. Thanks!
,
Apr 5 2018
Since cache-control includes must-revalidate, I don't think you are following the spec.
,
Apr 5 2018
I suspect we aren't, but the current behavior is definitely deliberate (To save bandwidth, reduce load times, speed startup, and make session restore/forward/back produce pages more consistently). I defer on the owners of the relevant session restore code if we want to consider changing behaviors here.
,
Apr 5 2018
Please consider changing the behaviour. Since we can't rely on the expected behaviour of must-revalidate what ends up happening is almost the exact opposite of your intentions. After it uses the stale file and our app starts it detects a version mismatch and has to force a reload. The spec is very specific in what must and must not happen when must-revalidate is used. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - 14.9.4 Cache Revalidation and Reload Controls must-revalidate: ...The must-revalidate directive is necessary to support reliable operation for certain protocol features. In all circumstances an HTTP/1.1 cache MUST obey the must-revalidate directive; in particular, if the cache cannot reach the origin server for any reason, it MUST generate a 504 (Gateway Timeout) response. Servers SHOULD send the must-revalidate directive if and only if failure to revalidate a request on the entity could result in incorrect operation, such as a silently unexecuted financial transaction. Recipients MUST NOT take any automated action that violates this directive, and MUST NOT automatically provide an unvalidated copy of the entity if revalidation fails. Although this is not recommended, user agents operating under severe connectivity constraints MAY violate this directive but, if so, MUST explicitly warn the user that an unvalidated response has been provided. The warning MUST be provided on each unvalidated access, and SHOULD require explicit user confirmation.
,
Apr 5 2018
Note that RFC 2616 is obsolete. https://tools.ietf.org/html/rfc7234 has the updated cache specs, though wording the doesn't differ significantly for this (Which seems weird to me - it's supposed to better repesent modern browser behavior, among other things, and no browser generates bogus 504 responses, though caching proxies do).
,
Apr 24 2018
mmenke@ A Gentle ping... Request you to please provide an update on this issue. Thanks..
,
Apr 24 2018
Per #5, I own neither the cache nor the session restore code, so I'll defer to the owners (It's really a session restore design decision, though it's a feature our cache does support).
,
May 11 2018
As per comment #9, ccing the owners of Internals>Network>Cache for further inputs on this issue and requesting to please have a look into the issue. Hence, adding label TE-NeedsTriageHelp for further investigation from dev team. Thanks...!!
,
May 11 2018
,
May 11 2018
The cache is doing what it's told by session restore and behaving correctly given that. This is an issue for session restore folks. Note: as a way to get around this, you could set vary-cookie and set a new random cookie on each load. The vary mismatch should still cause a revalidation. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by krajshree@chromium.org
, Apr 4 2018