X-Cache 标头解释
我正在浏览 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
CDN
(内容分发网络
)将X-cache
标头添加到 HTTP 响应。X-cache:HIT
表示您的请求由 CDN 而非源服务器提供服务。 CDN 是一个特殊的网络,旨在缓存内容,以便更快地处理 usr 请求+卸载源服务器。CDN
(Content Delivery Network
) addsX-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.X-Cache 中的前缀“X”表示标头不是标准HTTP 标头字段。而且它的含义因代理实现的不同而不同。查找这些标头字段的常见位置是鱿鱼服务器。组织和大学在其之间放置代理(squid)服务器
外网。这有两个目的。一是安全性,二是缓存更频繁的网页(以限制网络流量)。
两个 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).
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:
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.
对我来说,这与 fastcgi 缓存标头存在于 Nginx 服务器块上,
只需删除注释此行并重新启动 nginx,标头就会被删除。
for me me this was related to fastcgi cache header existing on Nginx server block
just removing commenting this line and restart nginx the header were removed .