68

I have a new author site that I want to make available from a domain that I had previously used Apache rewriting to bounce traffic to my Amazon site, [R=301,L], which I want to serve up as my own site. I also have a new domain for the interim at least.

Is there (are there) particular durations of times when Chrome in particular will store 301 cached redirects? Some other questions, How long do browsers cache HTTP 301s? and How is 301 redirect implemented by different browsers? , ask, and the answer is given that some browsers do not cache, some cache for the session, and Chrome and IE10 cache in a way that will survive a browser restart, but don't specify how long. Longer than the other browsers tested, but the amount is still unspecified.

So how long does Chrome store a 301 redirect? The questions cited do not specify what it is for Chrome or IE10.

Community
  • 1
  • 1
Christos Hayward
  • 5,777
  • 17
  • 58
  • 113
  • Even if you knew how long it was stored, would you want to rely on it? – Mooseman Apr 22 '13 at 19:07
  • 1
    Not by choice... but I have an Amazon author site at http://amazon.com/author/cjshayward , which I 301'ed http://cjshayward.com to. I've acquired and am using http://cjsh.name for the new site, also served up as cjshayward.com, and it would be nice to know that after a month the scaffolding domain name can be removed. – Christos Hayward Apr 23 '13 at 17:34
  • Why not keep the 301? – Mooseman Apr 23 '13 at 18:34
  • 10
    I'm afraid the answer might be 'until you clear the cache'. If you don't clear the cache, possibly until the heat death of the universe. But I'm not entirely sure. – aditsu quit because SE is EVIL Nov 18 '13 at 03:00
  • 1
    Please tell chrome we need a way out of this 301 hell hole: https://bugs.chromium.org/p/chromium/issues/detail?id=633023&can=1&q=clear%20301%20redirects&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified – B T Aug 01 '16 at 02:15
  • If you use cloudflare or similar service worth noting that also cache header redirects https://support.cloudflare.com/hc/en-us/articles/200168326-Are-301-and-302-redirects-cached-by-Cloudflare- – John Magnolia Oct 13 '17 at 13:33

6 Answers6

146

I resolved this by opening dev tools (F12), click "Network", then click the "Preserve log" checkbox, and make the request that results in the cached 301. Right-click the request that results in the 301 and click "clear browser cache". Try again and then 301 should no-longer be cached.

mystic cola
  • 1,465
  • 1
  • 21
  • 39
Sam Rueby
  • 5,914
  • 6
  • 36
  • 52
53

Go to chrome://net-internals and at the far right open the drop-down and choose "Clear Cache". As of version 48, this was the only thing that worked for me to clear a cached 301.

Update: Unfortunately, as of version 71 (Dec 2018) Google has removed the net-internals feature.

McGuireV10
  • 9,572
  • 5
  • 48
  • 64
13

The "view-source:"-solution does not work for me in Google Chrome; but using the developer tools and setting "disable cache" to true/checked in the Network-tab forces a re-evaluation. BTW: temporary circumvention can be achieved in an anonymous-session (Ctrl+Shift+N) or by adding some fake query-argument, like "?foo=bar", to the URL.

flowtron
  • 854
  • 7
  • 20
  • 1
    Thanks - made my day. Strangely, though, this doesn't work for localhost. – Olaf Nov 27 '14 at 16:42
  • 1
    Thank you so much, this was driving me mad! @Olaf are you sure? I just used this to stop `http://localhost:8000` from redirecting to `https://localhost:8000` – Dan Passaro Oct 21 '16 at 13:47
  • At least it didn't work two years ago. Maybe it does now. – Olaf Oct 21 '16 at 14:47
4

In either Chrome or Firefox, you can refresh the redirect by typing "view-source:redirect.yoursite.com" and hitting enter. Then, refresh that page. Now, that should force Chrome or Firefox to refresh the redirect.

mrbofus
  • 49
  • 2
4

The simplest solution to this is to open up F12 dev tools, check disable cache and then visit the place generating the 301 redirect. This should update to the newer version.

disable cache

ocdi
  • 415
  • 4
  • 9
2

For example we have cached redirect from http://example.com to https://example.com

  1. Go to Network tools
  2. Check "Preserve log"
  3. Go to http://example.com (it will redirect to https)
  4. Right click on refresh button and click on "Empty cache and Hard Reload"

screenshot

ijakparov
  • 21
  • 1