gpt4 book ai didi

http - Cache-Control s-maxage header 是否会覆盖浏览器缓存的 Expires header ?

转载 作者:可可西里 更新时间:2023-11-01 16:23:22 27 4
gpt4 key购买 nike

我想设置一个遥远 future 的 Expires header ,以减少来自各个浏览器的请求。

我还想设置 Cache-Control: s-maxage=600 以便代理缓存(和 CDN)每 10 分钟重新验证一次新鲜内容。

尽管存在带有 s-maxage 指令的 Cache-Control header (据说会取代它),浏览器是否会尊重 Expires header ?

最佳答案

如果响应同时包含 Expires 和 Cache-Control max-age 指令,则 max-age 会覆盖 Expires header ,即使 Expires header 更具限制性。此规则允许源服务器为给定响应提供比 HTTP/1.0 缓存更长的 HTTP/1.1 缓存过期时间。

来源:http://condor.depaul.edu/dmumaugh/readings/handouts/SE435/HTTP/node24.html

关于http - Cache-Control s-maxage header 是否会覆盖浏览器缓存的 Expires header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12479581/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com