Commit c404abad authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

* 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
parent 6d467a77
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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]
+14 −0
Changes for modules/cache/cache_storage.c: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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;
            }