]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backport r632749 from trunk:
authorEric Covener <covener@apache.org>
Fri, 14 Mar 2008 17:18:06 +0000 (17:18 +0000)
committerEric Covener <covener@apache.org>
Fri, 14 Mar 2008 17:18:06 +0000 (17:18 +0000)
mod_cache: Revalidate cache entities which have Cache-Control: no-cache
set in their response headers.  PR 44511 [Ruediger Pluem]

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

CHANGES
STATUS
modules/cache/cache_util.c

diff --git a/CHANGES b/CHANGES
index 205562c2a49c8f0346b842517757495c9afd98a9..4d77b15bf340d1367fca3b218de52c86fd1d7df8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
+  *) mod_cache: Revalidate cache entities which have Cache-Control: no-cache
+     set in their response headers. PR 44511 [Ruediger Pluem]
 
   *) mod_rewrite: Check all files used by DBM maps for freshness, mod_rewrite
      didn't pick up on updated sdbm maps due to this.
diff --git a/STATUS b/STATUS
index 59ff3ef0447737729aa28d054fefcc0cbe2f85af..0d535c6afc4981b04819b09d89dc748f8e50252b 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -86,14 +86,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * mod_cache: Revalidate cache entities which have Cache-Control: no-cache
-              set in their response headers. PR44511
-   Trunk version of patch:
-       http://svn.apache.org/viewcvs.cgi?rev=632749&view=rev
-   Backport version for 2.2.x of patch:
-       Trunk version of patch works
-   +1: rpluem, jim, covener
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 75d35bd64a906cd5da2e40588a67fb6f3f70b4a7..78770ffdcdefbefbe045dec2a079cd12bec35a8b 100644 (file)
@@ -235,6 +235,14 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h,
     cc_cresp = apr_table_get(h->resp_hdrs, "Cache-Control");
     expstr = apr_table_get(h->resp_hdrs, "Expires");
 
+    if (ap_cache_liststr(NULL, cc_cresp, "no-cache", NULL)) {
+        /*
+         * The cached entity contained Cache-Control: no-cache, so treat as
+         * stale causing revalidation
+         */
+        return 0;
+    }
+
     if ((agestr = apr_table_get(h->resp_hdrs, "Age"))) {
         age_c = apr_atoi64(agestr);
     }