]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Enable negative cacheing on unknown or -1 expiry timestamp
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 24 Jul 2011 13:24:24 +0000 (07:24 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 24 Jul 2011 13:24:24 +0000 (07:24 -0600)
This syncs the squid-3 code with what squid-2 does. There seem to be no
problems in squid-2, but squid-3 does not cache at times when it should
according to negative_ttl

src/store.cc

index 7d40515e357ea81492ee51c2b2d7b337ae3850ee..be313eb3313e905a6a888fe78447ea38c7f04042 100644 (file)
@@ -1431,7 +1431,9 @@ StoreEntry::checkNegativeHit() const
 void
 StoreEntry::negativeCache()
 {
-    if (expires == 0)
+    // XXX: should make the default for expires 0 instead of -1
+    //      so we can distinguish "Expires: -1" from nothing.
+    if (expires <= 0)
 #if HTTP_VIOLATIONS
         expires = squid_curtime + Config.negativeTtl;
 #else