]> granicus.if.org Git - apache/commitdiff
* If the cached entity contained Cache-Control: no-cache, treat it as stale
authorRuediger Pluem <rpluem@apache.org>
Sun, 2 Mar 2008 12:35:33 +0000 (12:35 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sun, 2 Mar 2008 12:35:33 +0000 (12:35 +0000)
  causing revalidation.

PR: 44511

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

CHANGES
modules/cache/cache_util.c

diff --git a/CHANGES b/CHANGES
index 75b68460734130082f4bd9eb6af685cfd3b476c1..02f1b41dddf1da0996155169d28d84a0f54e426e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) 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.
      PR41190 [Niklas Edmundsson]
index fdcba41a3e70b83374039a5f55cc3db45e6bfe84..ec2d749b6c7d9f74476169710c816b0d25c932a2 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);
     }