微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Safari合并在一起时,“ no-cache,no-store”是否只采用第一个Cache-Control“ no-cache”而不是“ no-store”?

如何解决Safari合并在一起时,“ no-cache,no-store”是否只采用第一个Cache-Control“ no-cache”而不是“ no-store”?

即使响应头包含 “缓存控件:无缓存,无存储” ,Safari仍在缓存CORS重定向图像(将Instructure Canvas图像上传到AWS S3存储桶) 。这将导致Safari发送“选项”调用以验证缓存的图像。这会导致重定向头混乱,并导致图像加载失败。 Chrome和Firefox不缓存图像。他们没有发送Options方法,因此第二次获取图像没有问题。

根据Mozilla “要禁用资源缓存,您可以发送以下响应标头”

  • GOOD:“缓存控制:无存储”
  • 坏:“缓存控制:无缓存,无存储”(它们是矛盾的)
no-cache:

The response may be stored by any cache,even if the response is normally non-cacheable.
However,the stored response MUST always go through validation with the origin server first
before using it,therefore,you cannot use no-cache in-conjunction with immutable. If you mean
to not store the response in any cache,use no-store instead. This directive is not effective in
preventing caches from storing your response.

Safari 是否有可能采用“ no-cache”指令并存储图像,而不必费心读取第二个“ no-store”指令?如果是这样,为什么有这么多帖子建议对“ Cache-Control”标头使用两个指令,而不仅仅是“ no-store”?

这些帖子内容繁琐,包括double指令,我想知道它们是否适用于使用Safari的用户How do we control web page caching,across all browsers?macOS Safari caching response,while headers specify no caching

这是添加两个指令的Instructure Canvas代码。我很想拉动删除“ no-cache”缓存指令。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。