How long does Chrome remember a 301 redirect?

ε祈祈猫儿з 提交于 2019-11-30 10:54:59

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.




回答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.




回答5:


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.



来源:https://stackoverflow.com/questions/16154672/how-long-does-chrome-remember-a-301-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!