<p>The else part is optional. The keywords <em>if</em>, <em>else</em> and <em>endif</em>
must be typed on their own lines, as if they were regular configuration directives.
+ <tag>max_stale</tag>
+ <p>Places an upper limit on how stale content Squid will serve from the cache if cache validation fails
+
<tag>memory_cache_mode</tag>
<p>Controls which objects to keep in the memory cache (cache_mem)
<verb>
This will be included by default if available (see the --without-netfilter-conntrack configure option for more details).
<p><em>miss</em> sets a value for a cache miss. It is available for both the tos and mark options and takes precedence over the preserve-miss feature.
+ <tag>refresh_pattern</tag>
+ <p>New option <em>max-stale=</em> to provide a maximum staleness factor. Squid won't
+ serve objects more stale than this even if it failed to validate the object.
+
<tag>tcp_outgoing_mark</tag>
<p>New configuration parameter <em>tcp_outgoing_mark</em>
<p>Allows packets leaving Squid on the server side to be marked with a Netfilter mark value in the same way as the existing tcp_outgoing_tos feature.
<tag>logformat</tag>
<p><em>%oa</em> tag not yet ported from 2.7
- <tag>max_stale</tag>
- <p>Not yet ported from 2.7
-
<tag>refresh_pattern</tag>
<p><em>stale-while-revalidate=</em> not yet ported from 2.7
<p><em>ignore-stale-while-revalidate=</em> not yet ported from 2.7
- <p><em>max-stale=</em> not yet ported from 2.7
<p><em>negative-ttl=</em> not yet ported from 2.7
<tag>refresh_stale_hit</tag>
(int) (100.0 * head->pct + 0.5),
(int) head->max / 60);
+ if (head->max_stale >= 0)
+ storeAppendPrintf(entry, " max-stale=%d", head->max_stale);
+
if (head->flags.refresh_ims)
storeAppendPrintf(entry, " refresh-ims");
time_t max = 0;
int refresh_ims = 0;
int store_stale = 0;
+ int max_stale = -1;
#if USE_HTTP_VIOLATIONS
refresh_ims = 1;
} else if (!strcmp(token, "store-stale")) {
store_stale = 1;
+ } else if (!strncmp(token, "max-stale=", 10)) {
+ max_stale = atoi(token + 10);
#if USE_HTTP_VIOLATIONS
} else if (!strcmp(token, "override-expire"))
#endif
} else
- debugs(22, 0, "redreshAddToList: Unknown option '" << pattern << "': " << token);
+ debugs(22, 0, "refreshAddToList: Unknown option '" << pattern << "': " << token);
}
if ((errcode = regcomp(&comp, pattern, flags)) != 0) {
if (store_stale)
t->flags.store_stale = 1;
+ t->max_stale = max_stale;
+
#if USE_HTTP_VIOLATIONS
if (override_expire)
See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
DOC_END
+NAME: max_stale
+COMMENT: time-units
+TYPE: time_t
+LOC: Config.maxStale
+DEFAULT: 1 week
+DOC_START
+ This option puts an upper limit on how stale content Squid
+ will serve from the cache if cache validation fails.
+ Can be overriden by the refresh_pattern max-stale option.
+DOC_END
+
NAME: refresh_pattern
TYPE: refreshpattern
LOC: Config.Refresh
ignore-must-revalidate
ignore-private
ignore-auth
+ max-stale=NN
refresh-ims
store-stale
not cache such responses because they usually can't be
reused. Note that such responses will be stale by default.
+ max-stale=NN provide a maximum staleness factor. Squid won't
+ serve objects more stale than this even if it failed to
+ validate the object. Default: use the max_stale global limit.
+
Basically a cached object is:
FRESH if expires < now, else STALE
STALE_EXPIRES,
STALE_MAX_RULE,
STALE_LMFACTOR_RULE,
+ STALE_MAX_STALE,
STALE_DEFAULT = 299
};
/*
* At this point the response is stale, unless one of
* the override options kicks in.
+ * NOTE: max-stale config blocks the overrides.
*/
+ int max_stale = (R->max_stale >= 0 ? R->max_stale : Config.maxStale);
+ if ( max_stale >= 0 && staleness < max_stale) {
+ debugs(22, 3, "refreshCheck: YES: max-stale limit");
+ if (request)
+ request->flags.fail_on_validation_err = 1;
+ return STALE_MAX_STALE;
+ }
+
if (sf.expires) {
#if USE_HTTP_VIOLATIONS
#if USE_HTTP_VIOLATIONS
time_t negativeTtl;
#endif
+ time_t maxStale;
time_t negativeDnsTtl;
time_t positiveDnsTtl;
time_t shutdownLifetime;
unsigned int ignore_auth:1;
#endif
} flags;
+ int max_stale;
};
/*