当客户端使用Cache-Control时,它意味着什么?
我以为我理解 Http 标头“Cache-Control: max-age=3600”的含义,但后来我在客户端请求中遇到它,如下所示:
Cache-Control: max-age=0
我不完全确定从客户端的角度来看这意味着什么。
任何见解都会很棒。
谢谢
I thought I understood what the Http Header "Cache-Control: max-age=3600" meant but then I came across it in a client request as this:
Cache-Control: max-age=0
I'm not entirely sure what this means from a client's perspective.
Any insight would be great.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案解释如下: http://www.w3.org /Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4
当用户代理使用时,其目的是获取中间缓存来重新验证响应 - 因此它不由服务器处理。
在服务器响应中,max-age 告诉客户端(和中间缓存)将响应缓存多长时间。
The answer is explained here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4
When used by user agents, its aim is to get intermediate caches to revalidate the response - so it's not for the server to deal with.
In server responses, max-age tells the client (and intermediate caches) how long to cache the response for.
这意味着浏览器永远不应该缓存页面,它应该始终检索页面的新副本。
This means that the browser should NEVER cache the page, it should always retrieve a fresh copy of the page.