X-Cache 标头解释

发布于 2024-09-05 04:43:04 字数 78 浏览 1 评论 0原文

我正在浏览 Firefox 本地缓存文件夹,发现很多包含 X-cache 标头的文件。有人可以解释一下这个标头的用途吗?

谢谢

I was going through the firefox local cache folder and found a lot of files containing the X-cache header. Can someone explain the purpose of this header ?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

檐上三寸雪 2024-09-12 04:43:04

CDN内容分发网络)将 X-cache 标头添加到 HTTP 响应。 X-cache:HIT 表示您的请求由 CDN 而非源服务器提供服务。 CDN 是一个特殊的网络,旨在缓存内容,以便更快地处理 usr 请求+卸载源服务器。

CDN (Content Delivery Network) adds X-cache header to HTTP Response. X-cache:HIT means that your request was served by CDN, not origin servers. CDN is a special network designed to cache content, so that usr request served faster + to unload origin servers.

桃酥萝莉 2024-09-12 04:43:04

X-Cache 中的前缀“X”表示标头不是标准HTTP 标头字段。而且它的含义因代理实现的不同而不同。查找这些标头字段的常见位置是鱿鱼服务器。组织和大学在其之间放置代理(squid)服务器
外网。这有两个目的。一是安全性,二是缓存更频繁的网页(以限制网络流量)。

X-Cache对应结果,代理是否已从缓存中提供结果(HIT为是,MISS为否)
X-Cache-Lookup 表示代理是否对请求有可缓存的响应(HIT 为是,MISS 为否)

两个 HIT 都表示客户端已发出可缓存请求,并且代理有一个匹配的可缓存响应,并被转发回客户端。
如果 X-Cache 为 MISS 并且 X-Cache_Lookup 为 HIT,则客户端发出的请求具有可缓存响应,但客户端强制绕过缓存。这是硬刷新,可以通过 Ctrl + F5 或发送 header 来模拟:
Pragma: no-cache(在 HTTP/1.0 中)和 Cache-Control: no-cache
(HTTP/1.1)
如果两者都是 MISS(es),则客户端的请求没有与该请求对应的任何有效对象。

一些有用的资源:

Prefix 'X' in X-Cache indicates that the header is not a standard HTTP Header Field. Also its meaning vary from one proxy implementation to another. A common place to find these header fields is in squid servers. Organizations and universities place proxy (squid) servers between their and
outer network. This serves two purposes. One of security, and other of caching more frequent web pages (in order to limit network traffic).

X-Cache corresponds to the result, whether the proxy has served the result from cache (HIT for yes, and MISS for no)
X-Cache-Lookup represents if the proxy has a cache-able response to the request (HIT for yes and MISS for no)

Both HITs means that the client has made a cache-able request and the proxy had a cache-able response that matched, and was forwarded back to the client.
In case X-Cache is MISS and X-Cache_Lookup is HIT, then the client made a request that had a cache-able response but was forced by the client to bypass the cache. This is hard refresh, which can be simulated by Ctrl + F5 or by sending headers:
Pragma: no-cache (in HTTP/1.0) and Cache-Control: no-cache
(HTTP/1.1)
If both are MISS(es) then the request by the client doesn't have any valid object corresponding to the request.

Some Useful Resources:

落墨 2024-09-12 04:43:04

X-Cache“不是标准的 HTTP 标头字段”。

另外,请查看 X -Cache 和 X-Cache-Lookup 标头解释

X-Cache "is NOT a standard HTTP header field".

Also, check out X-Cache and X-Cache-Lookup headers explained.

流心雨 2024-09-12 04:43:04

对我来说,这与 fastcgi 缓存标头存在于 Nginx 服务器块上,

  add_header X-Cache $upstream_cache_status;

只需删除注释此行并重新启动 nginx,标头就会被删除。

for me me this was related to fastcgi cache header existing on Nginx server block

  add_header X-Cache $upstream_cache_status;

just removing commenting this line and restart nginx the header were removed .

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