Am Sa, den 18.12.2004 schrieb Henrik Nordstrom um 15:31:
> you do not need to check that Config.minimum_expiry_time is non-zero.
> Using just
>
> int reason = refreshCheck(entry, NULL, Config.minimum_expiry_time);
>
> is better. If not it gets somewhat confusing to the administrator that
> setting "minimum_expiry_time 0 seconds" makes it use 60 seconds again..
You are right, this is wrong and confusing. Attached you find a fixed
patch. Is there any chance to get this small change included into
mainline?
Regards
Thomas
diff -ur squid-2.5.STABLE7.orig/src/cf.data.pre squid-2.5.STABLE7/src/cf.data.pre
--- squid-2.5.STABLE7.orig/src/cf.data.pre 2004-10-08 19:41:10.000000000 +0200
+++ squid-2.5.STABLE7/src/cf.data.pre 2004-12-17 21:47:42.000000000 +0100
@@ -4017,4 +4017,18 @@
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.
+DOC_END
+
EOF
diff -ur squid-2.5.STABLE7.orig/src/refresh.c squid-2.5.STABLE7/src/refresh.c
--- squid-2.5.STABLE7.orig/src/refresh.c 2002-07-18 11:22:17.000000000 +0200
+++ squid-2.5.STABLE7/src/refresh.c 2004-12-18 17:19:52.855354858 +0100
@@ -331,7 +331,7 @@
* 60 seconds delta, to avoid objects which expire almost
* immediately, and which can't be refreshed.
*/
- int reason = refreshCheck(entry, NULL, 60);
+ int reason = refreshCheck(entry, NULL, Config.minimum_expiry_time);
refreshCounts[rcStore].total++;
refreshCounts[rcStore].status[reason]++;
if (reason < 200)
diff -ur squid-2.5.STABLE7.orig/src/structs.h squid-2.5.STABLE7/src/structs.h
--- squid-2.5.STABLE7.orig/src/structs.h 2004-10-06 00:56:36.000000000 +0200
+++ squid-2.5.STABLE7/src/structs.h 2004-12-17 21:21:28.000000000 +0100
@@ -706,6 +706,7 @@
} warnings;
char *store_dir_select_algorithm;
int sleep_after_fork; /* microseconds */
+ time_t minimum_expiry_time; /* seconds */
external_acl *externalAclHelperList;
};