首页IT科技雪城爱超话(XCache and XCacheLookup headers explained)

雪城爱超话(XCache and XCacheLookup headers explained)

时间2025-06-21 02:00:56分类IT科技浏览5133
导读:Ok, maybe you have no problems while dealing with web caches but I (and my workmates as well :P do, so here it goes this post....

Ok, maybe you have no problems while dealing with web caches but I (and my workmates as well :P ) do, so here it goes this post.

Let imagine you are behind a classical transparent proxy on port 80 and you’re visiting a web site running an internal web cache (so, another proxy). If you inspect your HTTP headers looking for some info, you can find two lines that look like this, given domain.tld as the local website and proxy.local as your internal transparent proxy.

X-Cache HIT from proxy.domain.tld, MISS from proxy.local

X-Cache-Lookup HIT from proxy.domain.tld:3128, MISS from proxy.local:3128

What does this mean? That this is the first time you visit that website (MISS from proxy.local) and that their proxy has a valid copy of the page in its cache (X-Cache HIT proxy.domain.tld). I’ll explain X-Cache-Lookup meaning later

X-Cache MISS from proxy.domain.tld, MISS from proxy.local

X-Cache-Lookup HIT from proxy.domain.tld:3128, HIT from proxy.local:3128

Now, we’ve just refreshed the page (F5, Ctrl+R, you name it) but wait… what’s happening? It seems both proxies are not serving any page, and we’ve got two mysterious HITs in Cache-Lookup. Well, it’s very simple. We are not counting another level of cache. The browser web cache. So, the page now is not pulled at all from the net, instead Firefox (or your web browser of choice) is using it’s own cache to show the page, so we’ve got two MISSes in X-Cache but nonetheless both proxies are telling us that they would send the cache copy if asked. So, if you’re debugging your proxy system, it means it’s working correctly.

Now, what if we empty Firefox’s cache ??

Here it is:

X-Cache MISS from proxy.domain.tld, HIT from proxy.local

X-Cache-Lookup HIT from proxy.domain.tld:3128, HIT from proxy.local:3128

Our transparent proxy has got the page we need so it sends it to us (HIT from proxy.local), the remote proxy doesn’t need to do anything and both could send the page in case we want.

Although it could seem complicated, once you get it it’s very very simple, and you can easily nest more and more cache levels.

声明:本站所有文章            ,如无特殊说明或标注                  ,均为本站原创发布            。任何个人或组织      ,在未征得本站同意时            ,禁止复制            、盗用                  、采集      、发布本站内容到任何网站      、书籍等各类媒体平台                  。如若本站内容侵犯了原著者的合法权益                  ,可联系我们进行处理      。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
wind10关机自动重启(Win10关机之后自动重启)