]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Document HIT revalidation choices
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 28 Jan 2013 04:09:25 +0000 (21:09 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 28 Jan 2013 04:09:25 +0000 (21:09 -0700)
This adds cache.log entries at level 88,3 detailing the decisions why to
convert a HIT into a MISS or REFRESH response. Resolving a users FAQ.

src/client_side_reply.cc

index b1c8d1b035192e75cf7c7204ce09b0c8dc6cb30e..4b533f59c26a29c7039b9945cd6fdc3f14c99fde 100644 (file)
@@ -561,6 +561,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
         r->flags.needValidation = 1;
 
         if (e->lastmod < 0) {
+            debugs(88, 3, "validate HIT object? NO. Missing Last-Modified header. Do MISS.");
             /*
              * Previous reply didn't have a Last-Modified header,
              * we cannot revalidate it.
@@ -568,6 +569,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
             http->logType = LOG_TCP_MISS;
             processMiss();
         } else if (r->flags.noCache) {
+            debugs(88, 3, "validate HIT object? NO. Client sent CC:no-cache. Do CLIENT_REFRESH_MISS");
             /*
              * This did not match a refresh pattern that overrides no-cache
              * we should honour the client no-cache header.
@@ -575,12 +577,14 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
             http->logType = LOG_TCP_CLIENT_REFRESH_MISS;
             processMiss();
         } else if (r->protocol == AnyP::PROTO_HTTP) {
+            debugs(88, 3, "validate HIT object? YES.");
             /*
              * Object needs to be revalidated
              * XXX This could apply to FTP as well, if Last-Modified is known.
              */
             processExpired();
         } else {
+            debugs(88, 3, "validate HIT object? NO. Client protocol non-HTTP. Do MISS.");
             /*
              * We don't know how to re-validate other protocols. Handle
              * them as if the object has expired.