首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

What's the difference between Cache-Control: max-age=零 and no-cache

2013-12-15 
Whats the difference between Cache-Control: max-age0 and no-cache?As an aside, it appears to me t

What's the difference between Cache-Control: max-age=0 and no-cache?

As an aside, it appears to me that?Cache-Control: max-age=0, must-revalidate?should basically mean the same thing as?Cache-Control: no-cache. So maybe that's a way to get the?MUST-revalidate behavior ofno-cache, while avoiding the apparent migration of?no-cache?to doing the same thing as?no-store?(ie. no caching whatsoever)?


When sent by the user agent

I believe?shahkalpesh's answer?applies to the user agent side. You can also look at?13.2.6 Disambiguating Multiple Responses.

If a user agent sends a request with?Cache-Control: max-age=0?(aka. "end-to-end revalidation"), then each cache along the way will revalidate its cache entry (eg. with the?If-Not-Modified?header) all the way to the origin server. If the reply is then 304 (Not Modified), the cached entity can be used.

On the other hand, sending a request with?Cache-Control: no-cache?(aka. "end-to-end reload") doesn't revalidate and the server?MUST NOT?use a cached copy when responding.

热点排行