重定向后,浏览器是否会在新请求中设置在新请求中的浏览器?
因此,我正在使用此设置进行测试。 https://example.com/original
始终以308状态代码响应,将浏览器重定向到https://example.com/new
。 https://example.com/new
检查if-modified-since
和if-none-match
查看Cache是否仍然有效,如果是这样,将返回304。否则,它应该以全部内容和ETAG返回200,并在响应标头中进行最后修饰。
我看到的是,在重定向后,无论我多次尝试,在新请求中,https://example.com/new
浏览器没有If-modified-没有
由于
或如果不搭配
设置。因此,服务器始终用完整内容返回200。感觉就像浏览器只是没有尝试记住ETAG或Last-Modified
由https://example.com/new
返回。
是否有可能重定向响应(https://example.com/original
返回308)告诉浏览器记住ETAG或最后一个修改 - 在请求https://example.com/new
中,请勿摩擦?
So I'm testing with this setup. https://example.com/original
always responds with a 308 status code, redirecting the browser to https://example.com/new
.https://example.com/new
checks if If-Modified-Since
and If-None-Match
to see if cache is still valid, and returns 304 if so. Otherwise it should return 200 with the full content and ETag, Last-Modified in response header.
What I'm seeing is that after being redirected, however many times I try, in the new request to https://example.com/new
the browser does not have If-Modified-Since
or If-None-Match
set. Thus the server always return 200 with the full content. It feels like browser just does not try to remember ETag or Last-Modified
returned by https://example.com/new
.
Is it possible for the redirect response (https://example.com/original
which returns 308) to tell the browser to remember ETag or Last-Modified so it can include If-Modified-Since or If-None-Match in the request to https://example.com/new
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论