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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...