当客户端使用Cache-Control时,它意味着什么?

发布于 2024-07-23 06:10:28 字数 189 浏览 2 评论 0原文

我以为我理解 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风流物 2024-07-30 06:10:28

答案解释如下: 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.

居里长安 2024-07-30 06:10:28

这意味着浏览器永远不应该缓存页面,它应该始终检索页面的新副本。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文