网站需要使用Squid对天气数据和flickr图片搜索做缓存
碰到的问题是这些数据的HTTP头部带有
Cache-Control: no-store, must-revalidate
Cache-Control: no-cache, must-revalidate 缓存控制.
但是Squid对CC中的no-store 和 must-revalidate却无能为力
于是制作该补丁(for squid2.6STABLE),
给refresh_pattern增加两个参数ignore-no-store ignore-revalidate,使squid能对付这种情况
==============================
--- cache_cf_old.c Fri Jan 11 15:43:48 2008
+++ cache_cf.c Fri Jan 11 15:55:27 2008@ -2144,6 +2144,10 @
if (head-
+ if (head-
+
+ if (head-
+
#endif
storeAppendPrintf(entry, "
head = head-@ -2166,6 +2170,8 @
+
+
#endif
@ -2203,6 +2209,10 @
else if (!strcmp(token, "ignore-auth"))
+ else if (!strcmp(token, "ignore-no-store"))
+
+ else if (!strcmp(token, "ignore-revalidate"))
+
else if (!strcmp(token, "reload-into-ims")) {
@ -2250,6 +2260,10 @
t-
t-
+
+ t-
+
+ t-
#endif
--- structs_old.h Fri Jan 11 15:40:48 2008
+++ structs.h Fri Jan 11 15:41:57 2008@ -1944,6 +1944,8 @
unsigned int ignore_no_cache:1;
unsigned int ignore_private:1;
unsigned int ignore_auth:1;
+ unsigned int ignore_no_store:1;
+ unsigned int ignore_revalidate:1;
#endif
};
--- http_old.c Thu Jan 10 03:27:25 2008
+++ http.c Fri Jan 11 17:17:15 2008@ -241,7 +241,7 @
return 0;
return 0;
-
+
return 0;
/
--- refresh_old.c Thu Jan 10 03:27:40 2008
+++ refresh.c Fri Jan 11 17:17:43 2008@ -229,6 +229,10 @
uri = urlCanonical(request);
+#define REFRESH_OVERRIDE(flag)
+
