]> granicus.if.org Git - apache/commitdiff
* Remove expired content from cache that cannot be revalidated.
authorRuediger Pluem <rpluem@apache.org>
Sun, 3 Dec 2006 20:51:13 +0000 (20:51 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sun, 3 Dec 2006 20:51:13 +0000 (20:51 +0000)
PR: 30370

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481886 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/cache_storage.c

diff --git a/CHANGES b/CHANGES
index 6ea700a49f87cab4563d91c58afec1bad5ec137a..704408cece5bdca11cb6518b9b35bbe9474c157b 100644 (file)
--- 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]
index 460fa3dfd69bec5bf693088a98d0da4258fa9b9f..0b04a2aef87682a8d1ad3f0b4839646e6f415f6a 100644 (file)
@@ -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;
             }