当客户端使用Cache-Control时,它意味着什么? [英] What does Cache-Control mean when a client uses it?
问题描述
我以为我理解了Http HeaderCache-Control:max-age = 3600的意思,但后来我在客户端请求中遇到了它:
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.
任何见解都会很棒。
谢谢
推荐答案
答案在这里解释: 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.
在服务器响应中,max-age告诉客户端(和中间缓存)缓存响应的时间。
In server responses, max-age tells the client (and intermediate caches) how long to cache the response for.
这篇关于当客户端使用Cache-Control时,它意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!