如果您设置永久 HTTP 重定向(301 状态),那么浏览器是否每次仍会访问旧链接并获得重定向响应,或者它们是否会更好地了解并在执行请求之前在本地更改请求 URL?
最佳答案
不能保证,但他们应该缓存它,并且在实践中经常这样做。
来自spec :
The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise.
关于http - 浏览器的永久 HTTP 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10038001/