WebPagetest Forums
Why isn't 301 Cached? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: Why isn't 301 Cached? (/showthread.php?tid=12375)

Why isn't 301 Cached? - rviscomi - 07-01-2013 03:18 PM

In this test result, google.com is hit twice. It is getting a 301 redirect to http://www.google.com but on the repeat view, the browser is not using the cached redirect and attempts to hit google.com.

See http://www.webpagetest.org/result/130701_WE_120c0eebbc411e62a4fd367f426a31b1/

Why isn't the cached redirect used on the repeat view? My hunch is that despite the Expires and Cache-Control headers, it is lacking either an E-Tag or Last-Modified header. Is that the case here? Could this be an oversight?

Response headers:
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Mon, 01 Jul 2013 05:10:44 GMT
Expires: Wed, 31 Jul 2013 05:10:44 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

RE: Why isn't 301 Cached? - andydavies - 07-01-2013 06:55 PM

What happens in the other browsers?

RE: Why isn't 301 Cached? - pmeenan - 07-01-2013 11:28 PM

That's really bizarre. Initially I thought it might be an issue with getting data from dev tools and accidentally showing a request from cache but the timings and tcpdump show that it really is hitting the wire: http://cloudshark.org/captures/5c061ee495e8?filter=http

IE9: http://www.webpagetest.org/result/130701_VJ_cb5fa18c9229dcde1e5ae22151c58c09/
and Firefox: http://www.webpagetest.org/result/130701_VM_986521861f96e283383f77453bfdb2c5/

are both caching it as you'd expect.

Going to take some more digging to verify that it isn't something with how WPT runs the tests but it looks like a caching bug in Chrome to me. If so that would be a really good find.

RE: Why isn't 301 Cached? - rviscomi - 03-23-2015 04:46 PM

Hey Pat, remember this? I just reran the test and seeing the same results: http://www.webpagetest.org/result/150323_HJ_1568db680e099608e9b4f508dcd1991d/

Now we have a 301 to www and a 302 to https that are not showing up as cached in the repeat view.

RE: Why isn't 301 Cached? - pmeenan - 03-23-2015 10:31 PM

Good question. Needs a little validating to be sure it's not something WPT is doing but looks like a Chrome bug.

RE: Why isn't 301 Cached? - pmeenan - 03-23-2015 11:13 PM

Looks like a bug and Canary still has the same issue (Firefox and IE 11 correctly cache it). Just filed a Chrome bug on it: https://code.google.com/p/chromium/issues/detail?id=469675