New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 516846 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2015
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Chrome back button doesn't respect the cache-control:no-cache header

Reported by b...@mixmax.com, Aug 4 2015

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36

Steps to reproduce the problem:
1. Run the following script in node locally (using: npm install express && node script.js):

var express = require('express');
var app = express();
app.get('/nocache', function(req, res) {
    res.setHeader('Cache-Control', 'private, max-age=0, no-cache');
    res.send(new Date().toString() + '<br><a href="https://mixmax.com">Click to navigate away and then press ' +
        'Back. It will show the same timestamp.</a>');
});
app.get('/nostore', function(req, res) {
    res.setHeader('Cache-Control', 'no-cache, no-store');
    res.send(new Date().toString() + '<br><a href="https://mixmax.com">Click to navigate away and then press ' +
        'Back. It will update the timestamp.</a>');
});
app.listen('8030');

2. Visit http://localhost:8030/nocache. Click the link, then click the back button. Notice the timestamp isn't updated.
3. Now visit http://localhost:8030/nocache. Click the link, then click the back button. Notice the time IS updated.

What is the expected behavior?
See above

What went wrong?
In step 2, I'd expect Chrome to serve up a fresh copy of the content since the no-cache header is present. However, I apparently also need to add the 'no-store' header.

WebStore page: 

Did this work before? N/A 

Chrome version: 44.0.2403.125  Channel: n/a
OS Version: OS X 10.10.4
Flash Version: Shockwave Flash 18.0 r0
 

Comment 1 by b...@mixmax.com, Aug 4 2015

Also wrote https://mixmax.com/blog/chrome-back-button-cache-no-store with a bit more detail.
Cc: rvargas@chromium.org
Labels: Cr-Internals-Network-Cache
Status: WontFix
Working as intended.

Back/forward navigations retrieve stuff from the cache without revalidation.

Comment 4 by b...@mixmax.com, Aug 5 2015

Are you sure? Why is the content in the cache at all if it has 'no-cache'?
Because no-cache doesn't mean "don't cache this" (that would be no-store). no-cache means don't use this for normal loads unless the resource is revalidated for freshness. History navigations are not normal loads.
This resource might also be helpful:

http://madhatted.com/2013/6/16/you-do-not-understand-browser-history
For completeness, quite often what people want to do is to maintain the server on the loop because there is another condition that will be used to determine what to serve.

That is described by the spec as server-side revalidation (aka, Vary headers). In that case, it may be better to use Vary headers with the desired condition instead of going with no-store or other cache busting techniques.

Chrome will follow vary headers, even for history navigations.

Sign in to add a comment