Original 2.5 STABLE3 patch from Brian.
This adds two new config options:
1. refresh_all_ims (on/default off) will force all IMS queries to pass
through to the origin server (or parent cache).
2. refresh_patterns have a refresh-ims option, which does the same, but on a
more selective level.
:wq
/*
- * $Id: cache_cf.cc,v 1.460 2004/12/20 16:30:34 robertc Exp $
+ * $Id: cache_cf.cc,v 1.461 2004/12/22 16:21:33 serassio Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
(int) head->min / 60,
(int) (100.0 * head->pct + 0.5),
(int) head->max / 60);
+
+ if (head->flags.refresh_ims)
+ storeAppendPrintf(entry, " refresh-ims");
+
#if HTTP_VIOLATIONS
if (head->flags.override_expire)
time_t min = 0;
double pct = 0.0;
time_t max = 0;
+ int refresh_ims = 0;
#if HTTP_VIOLATIONS
int override_expire = 0;
/* Options */
while ((token = strtok(NULL, w_space)) != NULL) {
+ if (!strcmp(token, "refresh-ims")) {
+ refresh_ims = 1;
#if HTTP_VIOLATIONS
- if (!strcmp(token, "override-expire"))
+ } else if (!strcmp(token, "override-expire"))
override_expire = 1;
else if (!strcmp(token, "override-lastmod"))
override_lastmod = 1;
ignore_reload = 1;
refresh_nocache_hack = 1;
/* tell client_side.c that this is used */
- } else
#endif
+ } else
debug(22, 0) ("redreshAddToList: Unknown option '%s': %s\n",
pattern, token);
}
if (flags & REG_ICASE)
t->flags.icase = 1;
+ if (refresh_ims)
+ t->flags.refresh_ims = 1;
+
#if HTTP_VIOLATIONS
if (override_expire)
#
-# $Id: cf.data.pre,v 1.367 2004/12/21 17:52:53 robertc Exp $
+# $Id: cf.data.pre,v 1.368 2004/12/22 16:21:33 serassio Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
ignore-no-store
ignore-private
ignore-auth
+ refresh-ims
override-expire enforces min age even if the server
sent a Expires: header. Doing this VIOLATES the HTTP
this feature could make you liable for problems which
it causes.
+ refresh-ims causes squid to contact the origin server
+ when a client issues an If-Modified-Since request. This
+ ensures that the client will receive an updated version
+ if one is available.
+
Basically a cached object is:
FRESH if expires < now, else STALE
enabled in which case performance will suffer badly anyway..).
DOC_END
+NAME: refresh_all_ims
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+LOC: Config.onoff.refresh_all_ims
+DOC_START
+ When you enable this option, squid will always check
+ the origin server for an update when a client sends an
+ If-Modified-Since request. Many browsers use IMS
+ requests when the user requests a reload, and this
+ ensures those clients receive the latest version.
+
+ By default (off), squid may return a Not Modified response
+ based on the age of the cached version.
+DOC_END
+
NAME: reload_into_ims
IFDEF: HTTP_VIOLATIONS
COMMENT: on|off
/*
- * $Id: refresh.cc,v 1.66 2004/12/20 16:30:36 robertc Exp $
+ * $Id: refresh.cc,v 1.67 2004/12/22 16:21:33 serassio Exp $
*
* DEBUG: section 22 Refresh Calculation
* AUTHOR: Harvest Derived
/* request-specific checks */
if (request) {
HttpHdrCc *cc = request->cache_control;
+
+ if (request->flags.ims && (R->flags.refresh_ims || Config.onoff.refresh_all_ims)) {
+ /* The clients no-cache header is changed into a IMS query */
+ debug(22, 3) ("refreshCheck: YES: refresh-ims\n");
+ return STALE_FORCED_RELOAD;
+ }
+
#if HTTP_VIOLATIONS
if (!request->flags.nocache_hack) {
/*
- * $Id: structs.h,v 1.501 2004/12/22 15:10:37 serassio Exp $
+ * $Id: structs.h,v 1.502 2004/12/22 16:21:33 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
int mem_pools;
int test_reachability;
int half_closed_clients;
+ int refresh_all_ims;
#if HTTP_VIOLATIONS
int reload_into_ims;
unsigned int icase:
1;
+
+unsigned int refresh_ims:
+ 1;
#if HTTP_VIOLATIONS
unsigned int override_expire: