From: Ruediger Pluem Date: Sun, 3 Dec 2006 20:51:13 +0000 (+0000) Subject: * Remove expired content from cache that cannot be revalidated. X-Git-Tag: 2.3.0~2000 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7410019c694bc00b2d43d2a312afa51b774c49ee;p=apache * Remove expired content from cache that cannot be revalidated. PR: 30370 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481886 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 6ea700a49f..704408cece 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) mod_cache: Remove expired content from cache that cannot be revalidated. + PR 30370. [Ruediger Pluem] + *) mod_dbd: Stash DBD connections in request_config of initial request only, or else sub-requests and internal redirections may cause entire DBD pool to be stashed in a single HTTP request. [Chris Darroch] diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index 460fa3dfd6..0b04a2aef8 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -304,6 +304,20 @@ int cache_select(request_rec *r) } cache->stale_handle = h; } + else { + int irv; + + /* + * The copy isn't fresh enough, but we cannot revalidate. + * So it is the same case as if there had not been a cached + * entry at all. Thus delete the entry from cache. + */ + irv = cache->provider->remove_url(h, r->pool); + if (irv != OK) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, irv, r->server, + "cache: attempt to remove url from cache unsuccessful."); + } + } return DECLINED; }