【问题标题】:max-age, no-Cache,must-revalidate on Cache-Control Header, Which takes predence here?max-age, no-Cache,must-revalidate on Cache-Control Header,这里优先考虑哪个?
【发布时间】:2015-02-14 09:59:57
【问题描述】:

Cache-Control : max-age=86400, no-store, must-revalidate, no-cache

这是服务器为 JS 文件设置的响应头。

这是否意味着响应在重新验证之前缓存了 86400 秒?

以上哪一项优先,结果是什么?

【问题讨论】:

    标签: http caching http-headers response-headers


    【解决方案1】:

    看起来 no-cache 优先于所有。 HTTP1.1 规范说“If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server.” 参考http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

    它还显示“The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present.” 参考http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3

    以上都是针对 HTTP/1.1 的。

    【讨论】:

      猜你喜欢
      • 2019-01-17
      • 2018-11-24
      • 1970-01-01
      • 2011-01-25
      • 2016-04-28
      • 2018-10-06
      • 2013-08-11
      • 2019-07-09
      • 2019-04-23
      相关资源
      最近更新 更多