From: hno <> Date: Fri, 24 Dec 2004 05:17:20 +0000 (+0000) Subject: minumum_expiry_time directive X-Git-Tag: SQUID_3_0_PRE4~946 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a2f3fcfa92d538a389ef21d7716c68f219ddfe0;p=thirdparty%2Fsquid.git minumum_expiry_time directive The minimum caching time according to (Expires - Date) Headers Squid honors if the object can't be revalidated defaults to 60 seconds. In reverse proxy enorinments it might be desirable to honor shorter object lifetimes. It is most likely better to make your server return a meaningful Last-Modified header however. by Thomas Ristic --- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d16511eed7..6a2c375f4b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -92,5 +92,6 @@ and ideas to make this software available. Bruce Murphy Francis Daly Joachim Bauch + Thomas Ristic Duane Wessels diff --git a/src/cf.data.pre b/src/cf.data.pre index fa74f456a5..3d9e35b8e7 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.368 2004/12/22 16:21:33 serassio Exp $ +# $Id: cf.data.pre,v 1.369 2004/12/23 22:17:20 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -4549,4 +4549,18 @@ DOC_START until all the child processes have been started. DOC_END +NAME: minimum_expiry_time +COMMENT: (seconds) +TYPE: time_t +LOC: Config.minimum_expiry_time +DEFAULT: 60 seconds +DOC_START + The minimum caching time according to (Expires - Date) + Headers Squid honors if the object can't be revalidated + defaults to 60 seconds. In reverse proxy enorinments it + might be desirable to honor shorter object lifetimes. It + is most likely better to make your server return a + meaningful Last-Modified header however. +DOC_END + EOF diff --git a/src/refresh.cc b/src/refresh.cc index 350056f0c9..a2085fbed6 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -1,6 +1,6 @@ /* - * $Id: refresh.cc,v 1.67 2004/12/22 16:21:33 serassio Exp $ + * $Id: refresh.cc,v 1.68 2004/12/23 22:17:22 hno Exp $ * * DEBUG: section 22 Refresh Calculation * AUTHOR: Harvest Derived @@ -397,14 +397,11 @@ refreshIsCachable(const StoreEntry * entry) /* * Don't look at the request to avoid no-cache and other nuisances. * the object should have a mem_obj so the URL will be found there. - * 60 seconds delta, to avoid objects which expire almost - * immediately, and which can't be refreshed. + * minimum_expiry_time seconds delta (defaults to 60 seconds), to + * avoid objects which expire almost immediately, and which can't + * be refreshed. */ - /* For ESI, we use a delta of 0, as ESI objects typically can be - * refreshed, but the expiry may be low to enforce regular - * checks - */ - int reason = refreshCheck(entry, NULL, ESI ? 0 : 60); + int reason = refreshCheck(entry, NULL, Config.minimum_expiry_time); refreshCounts[rcStore].total++; refreshCounts[rcStore].status[reason]++; diff --git a/src/structs.h b/src/structs.h index 284da80636..765bd464cb 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.502 2004/12/22 16:21:33 serassio Exp $ + * $Id: structs.h,v 1.503 2004/12/23 22:17:22 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -716,6 +716,7 @@ struct _SquidConfig warnings; char *store_dir_select_algorithm; int sleep_after_fork; /* microseconds */ + time_t minimum_expiry_time; /* seconds */ external_acl *externalAclHelperList; #if USE_SSL