Cache-Control s-maxage标头是否覆盖浏览器缓存的Expires标头? [英] Does Cache-Control s-maxage header override Expires header for browser cache?

查看:322
本文介绍了Cache-Control s-maxage标头是否覆盖浏览器缓存的Expires标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个远期的Expires标头来减少从各个浏览器发出的请求。

I want to set a far future Expires headers to reduce requests made from individual browsers.

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

I'd also like to set Cache-Control: s-maxage=600 so that proxy caches (and CDNs) revalidate with the origin every 10 minutes for fresh content.

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

Will browsers honour the Expires header despite the existence of a Cache-Control header (which supposedly supersedes it) with a s-maxage directive?

推荐答案

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

If a response includes both an Expires and a Cache-Control max-age directive, the max-age overrides the Expires header, even if the Expires header is more restrictive. This rule allows an origin server to provide, for a given response, a longer expiration time to an HTTP/1.1 cache than to an HTTP/1.0 cache.

来源:< a href =http://condor.depaul.edu/dmumaugh/readings/handouts/SE435/HTTP/node24.html\"rel =nofollow> http://condor.depaul.edu/dmumaugh/readings/handouts/ SE435 / HTTP / node24.html

这篇关于Cache-Control s-maxage标头是否覆盖浏览器缓存的Expires标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆