]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r481886 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 4 Sep 2007 11:35:35 +0000 (11:35 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 4 Sep 2007 11:35:35 +0000 (11:35 +0000)
* Remove expired content from cache that cannot be revalidated.

PR: 30370

Submitted by: rpluem
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@572626 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/cache/cache_storage.c

diff --git a/CHANGES b/CHANGES
index d227a39cf44aa31898126c6f55a7930057842565..633cd8ca4303f880a7fa5a6c0e782b85013f487c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) mod_cache: Remove expired content from cache that cannot be revalidated.
+     PR 30370. [Ruediger Pluem]
+
   *) mod_proxy_http: accept proxy-sendchunked/proxy-sendchunks as synonymous.
      PR 43183 [Brian Rectanus <Brian.Rectanus breach.com>, Vincent Bray]
 
diff --git a/STATUS b/STATUS
index 2a0d71851cd46f3c029be8f39ef51f4a30a4eb13..143049f21d94f7aeb8fe42783751dfc9387f7d89 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -80,14 +80,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
 
-    * mod_cache: Remove expired content from cache that cannot be revalidated.
-      PR 30370.
-      Trunk version of patch:
-         http://svn.apache.org/viewcvs.cgi?rev=481886&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-      +1: rpluem, fielding, jim
-
     * mod_mem_cache: Increase the minimum and default value for
       MCacheMinObjectSize from 0 to 1, as a MCacheMinObjectSize of 0 does
       not make sense and leads to a signal Floating point exception (8)
index f02f26f3ee0d23bc0a78fd7b868c56a946b3877a..0ddf82dd39f0a2f9c6c2a5df8d2de6efdfe22e08 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;
             }