]> granicus.if.org Git - apache/commitdiff
mod_cache: cache_storage.c. Add the hostname and any request
authorPaul J. Reder <rederpj@apache.org>
Thu, 12 Sep 2002 16:56:56 +0000 (16:56 +0000)
committerPaul J. Reder <rederpj@apache.org>
Thu, 12 Sep 2002 16:56:56 +0000 (16:56 +0000)
args to the key generated for caching. This provides a unique
key for each virtual host and for each request with unique
args. [Paul J. Reder, args code provided by Kris Verbeeck]

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

CHANGES
modules/experimental/cache_storage.c

diff --git a/CHANGES b/CHANGES
index cf6158d4651fa13ca019abf5ac6e7c3984dda7d1..987944065b137138acec6a32fc1db62fd312d923 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 Changes with Apache 2.0.41
+  *) mod_cache: cache_storage.c. Add the hostname and any request
+     args to the key generated for caching. This provides a unique
+     key for each virtual host and for each request with unique
+     args. [Paul J. Reder, args code provided by Kris Verbeeck]
+
   *) mod_cache: Do not cache responses to GET requests with query
      URLs if the origin server does not explicitly provide an
      Expires header on the response (RFC 2616 Section 13.9)
index aeef53419a55c44d04a90a861d2bb164756dd852..b11118322309354c77772e64228ff715f67d9305 100644 (file)
@@ -294,8 +294,13 @@ apr_status_t cache_read_entity_body(cache_handle_t *h, apr_pool_t *p, apr_bucket
 
 apr_status_t cache_generate_key_default( request_rec *r, apr_pool_t*p, char**key ) 
 {
-   *key = apr_pstrdup(p,r->uri);
-   return APR_SUCCESS;
+    if (r->hostname) {
+        *key = apr_pstrcat(p, r->hostname, r->uri, "?", r->args, NULL);
+    }
+    else {
+        *key = apr_pstrcat(p, r->uri, "?", r->args, NULL);
+    }
+    return APR_SUCCESS;
 }
 
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(cache, CACHE, int, create_entity,