]> 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>
Fri, 20 Jan 2012 23:28:14 +0000 (16:28 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 20 Jan 2012 23:28:14 +0000 (16:28 -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 9ee0a8167e1920381715bf7316fc8cbcc2e31dd4..4bdedef23e11c893de6afd2d65c95dda90f255df 100644 (file)
@@ -367,6 +367,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());