]> granicus.if.org Git - apache/commitdiff
mod_disk_cache: When renegotiating an already cached Vary'd response, do not
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 17 May 2007 16:20:06 +0000 (16:20 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 17 May 2007 16:20:06 +0000 (16:20 +0000)
let us later throw away the renegotiated content due to a name mismatch.

We do not need to update the ->name field just before writing the headers as
the computed ->name on open and create is sufficient.  Updating ->name here is
essentially a no-op - except in the case of Vary where the key has internally
changed (to account for the Vary prefix), but the original name has not.
However, writing the Vary'd-accounted key means that when we read the cache
next that we will error out and disregard the just renegotiated response and
fetch the content all over again - oops!

(This is largely a case where I think we may have overthought ourselves; hence
the explanation is here in the commit rather than in the file itself.)

* modules/cache/mod_disk_cache.c
  (store_headers): The originally opened ->name is sufficient.
* CHANGES: Combined with r538992, note that renegotiation for Vary's seem to
  work far better.

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

CHANGES
modules/cache/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index 3e07455b78c885b7b6aa4e91d9219b8eae9b42d3..7835948d0903ff458b016d26adb1d40d90b10670 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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_disk_cache: Allow Vary'd responses to be refreshed properly.
+     [Justin Erenkrantz]
+
   *) mod_cache: Allow caching of requests with query arguments when
      Cache-Control max-age is explicitly specified.  [Justin Erenkrantz]
 
index cb9047071d2a8a1b46e886e7980be6907c0f9d66..f1a34d51e50aadcf0e52d24bb5b0f0bc92773bd3 100644 (file)
@@ -903,8 +903,6 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
         return rv;
     }
 
-    dobj->name = h->cache_obj->key;
-
     disk_info.format = DISK_FORMAT_VERSION;
     disk_info.date = info->date;
     disk_info.expire = info->expire;