--------------------- PatchSet 11761 Date: 2007/11/24 07:07:31 Author: hno Branch: HEAD Tag: (none) Log: ignore_ims_on_miss directive, making Squid ignore If-Modified-Since and If-None-Match on cache misses Members: src/cf.data.pre:1.444->1.445 src/http.c:1.436->1.437 src/structs.h:1.534->1.535 Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid/squid/src/cf.data.pre,v retrieving revision 1.444 retrieving revision 1.445 diff -u -r1.444 -r1.445 --- squid/src/cf.data.pre 23 Nov 2007 11:06:46 -0000 1.444 +++ squid/src/cf.data.pre 24 Nov 2007 07:07:31 -0000 1.445 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.444 2007/11/23 11:06:46 hno Exp $ +# $Id: cf.data.pre,v 1.445 2007/11/24 07:07:31 hno Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -4761,6 +4761,18 @@ acts on cacheable requests. DOC_END +NAME: ignore_ims_on_miss +IFDEF: HTTP_VIOLATIONS +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.ignore_ims_on_miss +DOC_START + This options makes Squid ignore If-Modified-Since on + cache misses. This is useful while the cache is + mostly empty to more quickly have the cache populated. +DOC_END + NAME: always_direct TYPE: acl_access LOC: Config.accessList.AlwaysDirect Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid/squid/src/http.c,v retrieving revision 1.436 retrieving revision 1.437 diff -u -r1.436 -r1.437 --- squid/src/http.c 21 Nov 2007 15:06:13 -0000 1.436 +++ squid/src/http.c 24 Nov 2007 07:07:31 -0000 1.437 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.436 2007/11/21 15:06:13 hno Exp $ + * $Id: http.c,v 1.437 2007/11/24 07:07:31 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1148,13 +1148,14 @@ /* append unless we added our own; * note: at most one client's ims header can pass through */ if (!httpHeaderHas(hdr_out, HDR_IF_MODIFIED_SINCE)) - httpHeaderAddClone(hdr_out, e); + if (!Config.onoff.ignore_ims_on_miss || !orig_request->flags.cachable || orig_request->flags.auth) + httpHeaderAddClone(hdr_out, e); break; case HDR_IF_NONE_MATCH: - /* append unless we added our own; - * note: at most one client's ims header can pass through */ + /* append unless ignore_ims_on_miss is in effect */ if (!httpHeaderHas(hdr_out, HDR_IF_NONE_MATCH)) - httpHeaderAddClone(hdr_out, e); + if (!Config.onoff.ignore_ims_on_miss || !orig_request->flags.cachable || orig_request->flags.auth) + httpHeaderAddClone(hdr_out, e); break; case HDR_MAX_FORWARDS: if (orig_request->method == METHOD_TRACE) { Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid/squid/src/structs.h,v retrieving revision 1.534 retrieving revision 1.535 diff -u -r1.534 -r1.535 --- squid/src/structs.h 23 Nov 2007 11:06:47 -0000 1.534 +++ squid/src/structs.h 24 Nov 2007 07:07:32 -0000 1.535 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.534 2007/11/23 11:06:47 hno Exp $ + * $Id: structs.h,v 1.535 2007/11/24 07:07:32 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -680,6 +680,7 @@ int global_internal_static; int httpd_suppress_version_string; int via; + int ignore_ims_on_miss; int check_hostnames; int allow_underscore; int cache_vary;