]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport from 2.1.
authorSander Striker <striker@apache.org>
Sat, 27 Sep 2003 18:17:10 +0000 (18:17 +0000)
committerSander Striker <striker@apache.org>
Sat, 27 Sep 2003 18:17:10 +0000 (18:17 +0000)
  *) mod_cache: Fix the cache code so that responses can be cached
     if they have an Expires header but no Etag or Last-Modified
     headers. PR 23130.
     [bjorn@exoweb.net]

Reviewed by: Paul J. Reder, Roy T. Fielding, Brian Pane

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

CHANGES
STATUS
modules/experimental/mod_cache.c

diff --git a/CHANGES b/CHANGES
index b1a0f57ab03ee25ceb681e6155b9752cf3919b3f..a83d9dbc3f69f926aae525522e472c9a84023644 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Changes with Apache 2.0.48
 
+  *) mod_cache: Fix the cache code so that responses can be cached
+     if they have an Expires header but no Etag or Last-Modified
+     headers. PR 23130.
+     [bjorn@exoweb.net]
+
   *) mod_log_config: Fix %b log format to write really "-" when 0 bytes
      were sent (e.g. with 304 or 204 response codes).  [Astrid Keßler]
 
diff --git a/STATUS b/STATUS
index 0398ceb1253bcb2edc9163c36ad0f131b1c475a9..abe2f7af1e88908ea94c16be75334230fbb08599 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2003/09/27 18:13:12 $]
+Last modified at [$Date: 2003/09/27 18:17:09 $]
 
 Release:
 
@@ -65,12 +65,6 @@ PATCHES TO PORT FROM 2.1
   [ please place file names and revisions from HEAD here, so it is easy to
     identify exactly what the proposed changes are! ]
 
-    * The cache code should be able to cache a response if it has an
-      Expires header but no Etag or Last-Modified headers. This submitted
-      patch (by bjorn@exoweb.net) resolves PR 23130.
-      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/experimental/mod_cache.c.diff?r1=1.76&r2=1.77
-      +1: rederpj, fielding, brianp
-
     * Modifies the cache code to be header-location agnostic. Also
       fixes a number of other cache code bugs related to PR 15852
       (an RFC 2616 violation).
index d93b48d9ab81c9a1b5cd415ee0b26e919d9abe17..d32d7f3e69c8e84b93b530fe54a822f3997f5215 100644 (file)
@@ -540,14 +540,14 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
         reason = "HTTP Status 304 Not Modified";
     }
     else if (r->status == HTTP_OK && lastmods == NULL && etag == NULL 
-             && (conf->no_last_mod_ignore ==0)) {
-        /* 200 OK response from HTTP/1.0 and up without a Last-Modified
-         * header/Etag 
+             && (exps == NULL) && (conf->no_last_mod_ignore ==0)) {
+        /* 200 OK response from HTTP/1.0 and up without Last-Modified,
+         * Etag, or Expires headers.
          */
-        /* XXX mod-include clears last_modified/expires/etags - this
+        /* Note: mod-include clears last_modified/expires/etags - this
          * is why we have an optional function for a key-gen ;-) 
          */
-        reason = "No Last-Modified or Etag header";
+        reason = "No Last-Modified, Etag, or Expires headers";
     }
     else if (r->header_only) {
         /* HEAD requests */
@@ -723,7 +723,6 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
     info->request_time = r->request_time;
 
     /* check last-modified date */
-    /* XXX FIXME we're referencing date on a path where we didn't set it */
     if (lastmod != APR_DATE_BAD && lastmod > date) {
         /* if it's in the future, then replace by date */
         lastmod = date;