Internet Explorer 7 是否通过正确缓存来尊重 Vary 标头?

发布于 2024-08-14 09:35:58 字数 612 浏览 2 评论 0原文

我使用的技术类似于 Rick Strahls 示例,但有注意到使用谷歌的速度追踪器

资源缓存:@10.88s - 以下资源指定“Vary”标头,该标头在大多数版本的 Internet Explorer 中禁用缓存。修复或删除以下资源的“Vary”标头:...

问题是哪些版本的 Internet Explorer?如果我包括一种仅对除早期版本的 Internet Explorer 之外的所有浏览器输出 Vary 的方法,这个问题会得到解决吗?

If AllowsCacheingOnVaryHeader() Then
  Response.AppendHeader("Vary", "Content-Encoding")
  Response.AppendHeader("Vary", "Accept-Encoding")
End If

在函数“AllowsCacheingOnVaryHeader()”中 - 我到底应该检查什么? IE 7、8 或 9 之前的所有版本?

I'm using a technique similar to Rick Strahls example, but have notcied using google's speed tracer that

Resource Caching : @10.88s - The following resources specify a "Vary" header that disables caching in most versions of Internet Explorer. Fix or remove the "Vary" header for the following resources: ...

The question is Which versions of internet explorer? If I include a way of only outputting Vary for all browsers except early version of internet explorer, will this get resolved?

If AllowsCacheingOnVaryHeader() Then
  Response.AppendHeader("Vary", "Content-Encoding")
  Response.AppendHeader("Vary", "Accept-Encoding")
End If

In the function "AllowsCacheingOnVaryHeader()" - what exactly should I be checking for? All version of IE prior to 7, 8 or 9?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧瑾黎汐 2024-08-21 09:35:58

请参阅 EricLaw 的 了解这方面的背景。

Response.AppendHeader("Vary", "Accept-Encoding")

应该没问题。最新的 IE6 应忽略 Vary: Accept-Encoding。我相信较旧的 IE6 SP 没有。

Response.AppendHeader("Vary", "Content-Encoding")

我不确定那是做什么用的。 Content-Encoding 是一个响应标头,而不是(通常)请求标头,那么如何对其进行 Vary 呢?它肯定会让 IE 崩溃,你能简单地删除它并完成它吗?

回答这个问题:不,IE7 仍然和 IE6 一样有问题,因为它使用相同的底层 wininet 代码。我没试过,但我希望 IE8 是一样的。当提供 ETag 时,IE7 的表现确实没那么糟糕(它重新验证资源而不是完全重新获取资源),但基本错误没有改变。

See EricLaw's for the background on this.

Response.AppendHeader("Vary", "Accept-Encoding")

Should be OK. An up-to-date IE6 should ignore Vary: Accept-Encoding. I believe older IE6 SPs didn't.

Response.AppendHeader("Vary", "Content-Encoding")

I'm not sure what that's for. Content-Encoding is a response header not (typically) a request header so how can you Vary on it? It will certainly trip IE up, can you simply remove that and be done with it?

To answer the question: no, IE7 is still just as broken as IE6 re Vary, as it's using the same underlying wininet code. I haven't tried it but I expect IE8 is the same. IE7 does behave less badly when an ETag is supplied (it revalidates the resource instead of fully refetching it), but the basic bug is unaltered.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文