Cache-Control : max-age=86400, no-store, must-revalidate, no-cache
这是服务器为 JS 文件设置的响应头。
这是否意味着响应在重新验证之前被缓存了 86400 秒?
以上哪个优先,结果是什么?
Cache-Control : max-age=86400, no-store, must-revalidate, no-cache
这是服务器为 JS 文件设置的响应头。
这是否意味着响应在重新验证之前被缓存了 86400 秒?
以上哪个优先,结果是什么?
看起来 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 的。