]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not add HTTP 110 and 111 Warnings to TCP_REFRESH_UNMODIFIED responses.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 21 Jan 2012 01:16:48 +0000 (18:16 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 Jan 2012 01:16:48 +0000 (18:16 -0700)
The old "stale if hit" logic did not account for cases where the stored
stale response became fresh due to a successful revalidation with the
origin server.
When the stored response was stale at the time of the request, we were
adding 110 "Response is stale" and even 111 "Revalidation failed"
Warning headers to responses while logging TCP_REFRESH_UNMODIFIED, which
is considered a hit.

src/client_side_reply.cc

index cb5d84b3e0a5f37024f246f9abd70159c527d895..c7e3f818038339870146909f5cbb5b39909f0373 100644 (file)
@@ -359,6 +359,7 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result)
     // origin replied 304
     if (status == HTTP_NOT_MODIFIED) {
         http->logType = LOG_TCP_REFRESH_UNMODIFIED;
+        http->request->flags.stale_if_hit = 0; // old_entry is no longer stale
 
         // update headers on existing entry
         old_rep->updateOnNotModified(http->storeEntry()->getReply());