重定向后,浏览器是否会在新请求中设置在新请求中的浏览器?

发布于 2025-02-11 07:22:25 字数 682 浏览 1 评论 0原文

因此,我正在使用此设置进行测试。 https://example.com/original始终以308状态代码响应,将浏览器重定向到https://example.com/newhttps://example.com/new检查if-modified-sinceif-none-match查看Cache是​​否仍然有效,如果是这样,将返回304。否则,它应该以全部内容和ETAG返回200,并在响应标头中进行最后修饰。

我看到的是,在重定向后,无论我多次尝试,在新请求中,https://example.com/new浏览器没有If-modified-没有由于如果不搭配设置。因此,服务器始终用完整内容返回200。感觉就像浏览器只是没有尝试记住ETAG或Last-Modifiedhttps://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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文