--------------------- PatchSet 5822 Date: 2003/07/13 19:27:42 Author: hno Branch: collapsed_forwarding-2_5 Tag: (none) Log: Replace collapsed_forwarding_stale_hit by a more generic refresh_stale X seconds not dependent on collapsed_forwarding to be enabled. This allows for concurrent cache hitswhile an object is being revalidated if it expired less than X seconds ago. Members: src/client_side.c:1.47.2.31.4.7->1.47.2.31.4.8 src/refresh.c:1.7.20.1.10.1->1.7.20.1.10.2 src/structs.h:1.48.2.11.4.4->1.48.2.11.4.5 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.31.4.7 retrieving revision 1.47.2.31.4.8 diff -u -r1.47.2.31.4.7 -r1.47.2.31.4.8 --- squid/src/client_side.c 12 Jul 2003 11:28:41 -0000 1.47.2.31.4.7 +++ squid/src/client_side.c 13 Jul 2003 19:27:42 -0000 1.47.2.31.4.8 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.31.4.7 2003/07/12 11:28:41 hno Exp $ + * $Id: client_side.c,v 1.47.2.31.4.8 2003/07/13 19:27:42 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -416,10 +416,12 @@ http->log_uri, http->request->flags, http->request->method); - if (Config.onoff.collapsed_forwarding && http->entry->mem_obj) { - http->entry->mem_obj->ims_entry = entry; + if (http->entry->mem_obj) { http->entry->mem_obj->ims_timestamp = squid_curtime; - storeLockObject(http->entry->mem_obj->ims_entry); + if (Config.onoff.collapsed_forwarding) { + http->entry->mem_obj->ims_entry = entry; + storeLockObject(http->entry->mem_obj->ims_entry); + } } } /* NOTE, don't call storeLockObject(), storeCreateEntry() does it */ @@ -1610,8 +1612,8 @@ return; } #endif - if (Config.onoff.collapsed_forwarding_stale && e->mem_obj && e->mem_obj->ims_entry && e->mem_obj->ims_timestamp + 30 > squid_curtime && !refreshCheckHTTPStale(e, r)) { - debug(33, 2) ("clientProcessHit: collapsed_forwarding_stale_hit\n"); + if (Config.refresh_stale_window > 0 && e->mem_obj && e->mem_obj->ims_timestamp + Config.refresh_stale_window > squid_curtime && !refreshCheckHTTPStale(e, r)) { + debug(33, 2) ("clientProcessHit: refresh_stale HIT\n"); goto hit; } if (!Config.onoff.offline && refreshCheckHTTP(e, r) && !http->flags.internal) { Index: squid/src/refresh.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/refresh.c,v retrieving revision 1.7.20.1.10.1 retrieving revision 1.7.20.1.10.2 diff -u -r1.7.20.1.10.1 -r1.7.20.1.10.2 --- squid/src/refresh.c 12 Jul 2003 09:52:49 -0000 1.7.20.1.10.1 +++ squid/src/refresh.c 13 Jul 2003 19:27:44 -0000 1.7.20.1.10.2 @@ -1,6 +1,6 @@ /* - * $Id: refresh.c,v 1.7.20.1.10.1 2003/07/12 09:52:49 hno Exp $ + * $Id: refresh.c,v 1.7.20.1.10.2 2003/07/13 19:27:44 hno Exp $ * * DEBUG: section 22 Refresh Calculation * AUTHOR: Harvest Derived @@ -368,7 +368,7 @@ int refreshCheckHTTPStale(const StoreEntry * entry, request_t * request) { - int reason = refreshCheck(entry, request, -30); + int reason = refreshCheck(entry, request, -Config.refresh_stale_window); return (reason < 200) ? 0 : 1; } Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.11.4.4 retrieving revision 1.48.2.11.4.5 diff -u -r1.48.2.11.4.4 -r1.48.2.11.4.5 --- squid/src/structs.h 12 Jul 2003 09:55:14 -0000 1.48.2.11.4.4 +++ squid/src/structs.h 13 Jul 2003 19:27:43 -0000 1.48.2.11.4.5 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.11.4.4 2003/07/12 09:55:14 hno Exp $ + * $Id: structs.h,v 1.48.2.11.4.5 2003/07/13 19:27:43 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -593,7 +593,6 @@ int pipeline_prefetch; int request_entities; int collapsed_forwarding; - int collapsed_forwarding_stale; } onoff; acl *aclList; struct { @@ -693,6 +692,7 @@ char *store_dir_select_algorithm; int sleep_after_fork; /* microseconds */ external_acl *externalAclHelperList; + time_t refresh_stale_window; }; struct _SquidConfig2 {