开发者

Is it possible to set a Request Header in a Squid Request to respond with a 404 if not found in Cache?

I have tried to look at the documentation, but have 开发者_运维技巧not found any info on this yet.


You could do this with two squids (or a squid and an apache instance with mod_proxy)...

Configure squid1 to use squid2 as its parent cache_peer. Configure the second squid as a proxy only with no caching enabled.

With this configuration in place, populate whatever content you need into squid1's cache by making requests for the needed content.

When you're ready to "close the door", so to speak, make a url_rewriter helper for squid2 that simply returns a single string containing known-invalid URL. Restart squid2 with the url_rewriter in place.

When this config is in place, cached content will be served normally, while squid1 will go to squid2 for uncached content, which will return a 404 for all URLs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜