mgarbutt@ozland.net.au writes:
>Hi,
>
>Does anyone know if the direct fetch bug/problem been fixed in squid.
>
>I have been testing here for some time on the new communicator with squid
>1.1.8 and it always forces a direct fetch, does any of the news squids
>stop this.
Try this patch included below, and add this to your squid.conf:
reload_into_ims on
This patch is designed to have the following effects
* if the request includes both 'no-cache' and 'If-Modified-Since'
the 'no-cache' is simply ignored
* if the request includes only 'no-cache' then Squid
makes an 'If-Modified-Since' request out the other side.
Duane W.
Index: src/cache_cf.c
===================================================================
RCS file: /surf1/CVS/squid/src/cache_cf.c,v
retrieving revision 1.174.2.19
diff -w -u -r1.174.2.19 cache_cf.c
--- cache_cf.c 1997/07/09 16:47:56 1.174.2.19
+++ cache_cf.c 1997/07/29 17:02:20
@@ -1362,6 +1362,8 @@
parseOnOff(&Config.Options.client_db);
else if (!strcmp(token, "query_icmp"))
parseOnOff(&Config.Options.query_icmp);
+ else if (!strcmp(token, "reload_into_ims"))
+ parseOnOff(&Config.Options.reload_into_ims);
else if (!strcmp(token, "minimum_direct_hops"))
parseIntegerValue(&Config.minDirectHops);
@@ -1605,6 +1607,7 @@
Config.Options.enable_purge = DefaultOptionsEnablePurge;
Config.Options.client_db = DefaultOptionsClientDb;
Config.Options.query_icmp = DefaultOptionsQueryIcmp;
+ Config.Options.reload_into_ims = 0;
}
static void
Index: src/cache_cf.h
===================================================================
RCS file: /surf1/CVS/squid/src/Attic/cache_cf.h,v
retrieving revision 1.92.2.6
diff -w -u -r1.92.2.6 cache_cf.h
--- cache_cf.h 1997/07/09 16:47:57 1.92.2.6
+++ cache_cf.h 1997/07/29 17:02:20
@@ -278,6 +278,7 @@
int client_db;
int query_icmp;
int icp_hit_stale;
+ int reload_into_ims;
} Options;
char *fake_ua;
};
Index: src/icp.c
===================================================================
RCS file: /surf1/CVS/squid/src/icp.c,v
retrieving revision 1.228.2.28
diff -w -u -r1.228.2.28 icp.c
--- icp.c 1997/07/25 18:43:46 1.228.2.28
+++ icp.c 1997/07/29 17:02:25
@@ -347,9 +347,13 @@
}
}
if ((t = mime_get_header(request_hdr, "Pragma"))) {
- if (!strcasecmp(t, "no-cache"))
+ if (!strcasecmp(t, "no-cache")) {
+ if (Config.Options.reload_into_ims)
+ BIT_SET(request->flags, REQ_NOCACHE_SPECIAL);
+ else
BIT_SET(request->flags, REQ_NOCACHE);
}
+ }
if (mime_get_header(request_hdr, "Range")) {
BIT_SET(request->flags, REQ_NOCACHE);
BIT_SET(request->flags, REQ_RANGE);
@@ -808,6 +812,13 @@
icpState->log_type = LOG_TCP_MISS;
storeRelease(entry);
entry = NULL;
+ } else if (BIT_TEST(request->flags, REQ_NOCACHE_SPECIAL)) {
+ if (BIT_TEST(request->flags, REQ_IMS))
+ icpState->log_type = LOG_TCP_IMS_MISS;
+ else if (request->protocol == PROTO_HTTP)
+ icpState->log_type = LOG_TCP_REFRESH_MISS;
+ else
+ icpState->log_type = LOG_TCP_MISS; /* XXX zoinks */
} else if (BIT_TEST(request->flags, REQ_NOCACHE)) {
/* NOCACHE should always eject a negative cached object */
if (BIT_TEST(entry->flag, ENTRY_NEGCACHED))
Index: src/squid.conf.pre.in
===================================================================
RCS file: /surf1/CVS/squid/src/Attic/squid.conf.pre.in,v
retrieving revision 1.93.2.12
diff -w -u -r1.93.2.12 squid.conf.pre.in
--- squid.conf.pre.in 1997/07/09 16:47:59 1.93.2.12
+++ squid.conf.pre.in 1997/07/25 23:24:52
@@ -1223,3 +1223,10 @@
# it is probably okay to set this to 'on'.
#
#icp_hit_stale off
+
+# TAG: reload_into_ims
+# Enable this if you want to turn 'Pragma: no-cache' requests
+# into If-Modified-Since requests. Off by default, use at your
+# own risk.
+#
+#reload_into_ims off
Index: src/url.h
===================================================================
RCS file: /surf1/CVS/squid/src/Attic/url.h,v
retrieving revision 1.40.2.4
diff -w -u -r1.40.2.4 url.h
--- url.h 1997/07/10 23:42:22 1.40.2.4
+++ url.h 1997/07/29 17:02:32
@@ -95,7 +95,7 @@
#define REQ_IMS 0x04
#define REQ_AUTH 0x08
#define REQ_CACHABLE 0x10
-#define REQ_UNUSED2 0x20
+#define REQ_NOCACHE_SPECIAL 0x20
#define REQ_HIERARCHICAL 0x40
#define REQ_LOOPDETECT 0x80
#define REQ_PROXY_KEEPALIVE 0x100
Received on Tue Jul 29 1997 - 10:17:34 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:52 MST