我正在调试HTTP 301永久重定向的问题.经过快速测试后,似乎Safari在重启时清除了301s的缓存,但Firefox却没有.
IE,Chrome,Firefox和Safari什么时候清除301s的缓存?
更新:例如,如果我想重定向example1.com到example2.com,但我不小心将其设置为重定向到example3.com,这是一个问题.我可以纠正错误,但是example1.com在此期间访问过的任何人都会将错误的重定向缓存到example3.com,因此他们将无法访问example1.com或者example2.com直到他们的缓存被清除.经过调查,我发现,没有Cache-Control和Expires标题设置.不正确的301响应的标头将是这样的:
HTTP/1.1 301 Moved Permanently
Date: Wed, 27 Feb 2013 12:05:53 GMT
Server: Apache/2.2.21 (Unix) DAV/2 PHP/5.3.8
X-Powered-By: PHP/5.3.8
Location: http://example3.com/
Content-Type: text/html
Run Code Online (Sandbox Code Playgroud)
我自己的测试表明: