From: wessels <> Date: Wed, 16 Sep 1998 02:24:07 +0000 (+0000) Subject: look for cached HEAD objects for HEAD requests -- don't always look for X-Git-Tag: SQUID_3_0_PRE1~2711 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c7ccf7736f1cd09a716db9f6634cee141303581;p=thirdparty%2Fsquid.git look for cached HEAD objects for HEAD requests -- don't always look for GET objects for HEAD requests --- diff --git a/src/client_side.cc b/src/client_side.cc index 2a2e508e49..630ebfc16d 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.395 1998/09/15 06:23:05 wessels Exp $ + * $Id: client_side.cc,v 1.396 1998/09/15 20:24:07 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1574,11 +1574,13 @@ clientProcessRequest2(clientHttpRequest * http) const request_t *r = http->request; const cache_key *key; StoreEntry *e; - if (r->method == METHOD_HEAD) - key = storeKeyPublic(http->uri, METHOD_GET); - else - key = storeKeyPublic(http->uri, r->method); + key = storeKeyPublic(http->uri, r->method); e = http->entry = storeGet(key); + if (r->method == METHOD_HEAD && e == NULL) { + /* We can generate a HEAD reply from a cached GET object */ + key = storeKeyPublic(http->uri, METHOD_GET); + e = http->entry = storeGet(key); + } #if USE_CACHE_DIGESTS http->lookup_type = e ? "HIT" : "MISS"; #endif