问题描述
有什么办法可以忽略客户端Cache-Control: max-age=0"并始终让squid返回陈旧内容?
There is any way to ignore client "Cache-Control: max-age=0" and always let squid to return stale content?
在 Squid 3.2 中使用ignore-cc"工作并且请求永远不会到达后端(仅在重新验证时),总是过时但在 Squid 2.7 中工作正常,除非您发送 Cache-control: max-age=0 和 If-Modified-Since 标头.
In Squid 3.2 works using "ignore-cc" and the request never reaches backend (only while revalidating), always is stale but in Squid 2.7 works fine unless you send the Cache-control: max-age=0 and If-Modified-Since headers.
推荐答案
好吧,在尝试了所有替代方案之后,我修改了源代码以实现该功能.
Well, after trying all alternatives, I modified the source code to implement the feature.
我在 Squid-2.7-stable9 中更改了文件 src/refresh.c:282:
I changed in the Squid-2.7-stable9 the file src/refresh.c:282:
282: if (request) {
为了
282: if (request && FALSE) {
他们在 3.X 中做了类似的事情来实现 ignoreCc:
They do something like that in the 3.X to implement ignoreCc:
269: if (request && !request->flags.ignore_cc) {
按预期工作.
这篇关于如何在squid 2.7中使用3.1特性“ignore-cc"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!