You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2008/03/14 18:18:08 UTC

svn commit: r637167 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/cache/cache_util.c

Author: covener
Date: Fri Mar 14 10:18:06 2008
New Revision: 637167

URL: http://svn.apache.org/viewvc?rev=637167&view=rev
Log:
backport r632749 from trunk:
mod_cache: Revalidate cache entities which have Cache-Control: no-cache
set in their response headers.  PR 44511 [Ruediger Pluem]
 

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/cache/cache_util.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=637167&r1=637166&r2=637167&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Fri Mar 14 10:18:06 2008
@@ -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.

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=637167&r1=637166&r2=637167&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Fri Mar 14 10:18:06 2008
@@ -86,14 +86,6 @@
 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 ]
 

Modified: httpd/httpd/branches/2.2.x/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/cache_util.c?rev=637167&r1=637166&r2=637167&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/cache_util.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/cache_util.c Fri Mar 14 10:18:06 2008
@@ -235,6 +235,14 @@
     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);
     }