New issue
Advanced search Search tips

Issue 633023 link

Starred by 19 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Feature Request: I need a way to clear the 301 redirect cache

Reported by freshene...@gmail.com, Aug 1 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce the problem:
1. Create a server that sets a 301 redirect in the header
2. Load that page in chrome
3. Remove the redirect from the header

What is the expected behavior?
There should be a way to clear the 301 redirect

What went wrong?
I was messing around with apache URL rewrites, not knowing it would use 301 redirects to do that (which isn't what I wanted). Now I can't access my website from my browser. Is my only option to reinstall chrome? Would that even solve the problem?

Did this work before? N/A 

Chrome version: 51.0.2704.103  Channel: n/a
OS Version: 6.3
Flash Version: Shockwave Flash 22.0 r0

Lots and lots of people have wanted a way to do this. Its absurd that there isn't a way to clear this behavior since it really has the potential for screwing things up. 

https://bugs.chromium.org/p/chromium/issues/detail?id=168554&can=1&q=clear%20301%20redirects&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

http://getluky.net/2010/12/14/301-redirects-cannot-be-undon/
https://news.ycombinator.com/item?id=11132736
http://rwec.co.uk/blog/2011/10/cached-redirects-considered-harmful/
 
Cc: nyerramilli@chromium.org
Labels: M-54
Status: Untriaged (was: Unconfirmed)
Thanks for the report, marking as Untriaged and requesting Dev team to check the issue and update.
This issue is behind http://stackoverflow.com/questions/16154672/how-long-does-chrome-remember-a-301-redirect?noredirect=1#comment64759764_16154672. Copying and pasting my basenote:


5
down vote
favorite
2
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.


Components: Internals>Network
Labels: -Type-Bug Type-Feature
Components: -Internals>Network Internals>Network>Cache
I'm not sure how we'd expose a setting just to clear redirects; it seems like we could end up with a million "fix this particular incorrect kind of cache entry" buttons.

I'm not marking it WontFix myself, but I expect the eventual answer will be "you just need to clear your entire cache".
The browser should at least "Flush" the re-direct when it detected a "re-direct loop"
If the browsers currently has a cached 301 redirect and the site your redirecting to sends it back, you run into this (even though the original redirect is gone.

This hosting nightmare
Previous provider had 301 redirect of https -> http
new provider has redirect of http -> https
Any visitors that had previously visited site now get "redirect loop"

Comment 7 by gavit...@gmail.com, Sep 19 2016

I argue that adding 301 caching to the browser broke expected behaviour for me, so I would expect a feature flag to turn it off.   With this change, I am no longer able to use chrome to do my day job effectively, and will have to migrate to Firefox. 

Comment 8 by jeff@mcneill.io, Oct 16 2016

caching 301 redirects in the browser essentially breaks the ability of servers to set and unset redirects. This cost me an entire day of what should have been productive work. 

Comment 9 by jeff@mcneill.io, Oct 16 2016

There is a way to clear the 301s, as follows:

To clear a permanent redirect in the browser cache, go to chrome://net-internals and at the far right open the drop-down and choose "Clear Cache". 
I have tried every possible fix like comment #9, hard reload, clearing cache, and nothing works.  Once the localhost redirect is in chrome it seems to be there forever.  THIS IS AN ACTUAL BUG!

Comment 11 by st...@zeppelin.no, Nov 6 2017

Is there any way to manually remove these cache entries (without clearing cache completely, which is really annoying).

At least it should be possible to blacklist certain domains/ip-addresses (and localhost/127.0.0.1 should be blacklisted by default) from caching redirects.
I just destroyed my non-inkognito chrome because of a one character typo caused production settings to be used instead of local settings, causing a permanent redirect from http://localhost:8000/ to https://localhost:8000/ 

Comment 12 by st...@zeppelin.no, Nov 6 2017

Okay, clearing cache as #9 sais, actually works, but that is really well hidden (It took me some time finding the correct button even with that explaination).
So if you ever mess up a permanent redirect on a live server; you'll never be able to explain to a customer how to do this, ignoring that you cannot possibly guide every visitor to do so... So it should be a way to clear this cache from server side somehow.
clearing the 301 cache by using chrome://net-internals is very un-intuitive, it should be cleared by "Disable Cache" function in the debug inspector, or in by clicking "clear site data" button in Application tab of the inspector, neither of them currently works as of version 62

Comment 14 by gavit...@gmail.com, Nov 23 2017

tbf,  it should be cleared by the "empty cache and hard reload" command under the refresh button, which is now only visible when the inspector window is open.  

Comment 15 by danla...@gmail.com, Mar 16 2018

For development purposes, there should be a way to turn off redirect caching altogether.
It appears that Chrome 68 does clear the redirect cache if you click "Disable Cache" under the Network tab in Developer Tools and then reload. Don’t know if this cache clearing was introduced recently or has always been there.

For the localhost case, I would check what it says for the 301 entry in the Network tab. Does it say "from disk cache"? In that case, it’s cached, otherwise it’s not.

FWIW, I think Shift-Refresh should clear the redirect cache for the requested URL. This would be helpful for end-users in case the webmaster set the redirect incorrectly for whatever reason and then fixed the error. Refresh alone doesn’t need to do this, only Shift-Refresh.

Sign in to add a comment