What does Cache-Control mean when a client uses it?

心不动则不痛 提交于 2019-12-21 09:11:04

问题


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


回答1:


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.




回答2:


This means that the browser should NEVER cache the page, it should always retrieve a fresh copy of the page.



来源:https://stackoverflow.com/questions/966376/what-does-cache-control-mean-when-a-client-uses-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!