]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Robert Collins <robertc@robertcollins.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Jun 2010 09:35:30 +0000 (21:35 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Jun 2010 09:35:30 +0000 (21:35 +1200)
Bug 2950: HTTP responses with no Date, L-M or Expires can now be cached

HTTP responses with no Date, Last-modified or Expires headers can
now be cached (given an appropriate refresh_pattern). Previously we
were not caching them in case of an infinite loop in cache farms:
however Squid adds Date: headers now which remove that concern.

src/http.cc

index e8f4f259ce063b82f2050fe4834c53ebd8400490..e213082930015e74e7206ef1551207836864ce0f 100644 (file)
@@ -444,23 +444,9 @@ HttpStateData::cacheableReply()
         if (!refreshIsCachable(entry)) {
             debugs(22, 3, "refreshIsCachable() returned non-cacheable..");
             return 0;
-        }
-
-        /* don't cache objects from peers w/o LMT, Date, or Expires */
-        /* check that is it enough to check headers @?@ */
-        if (rep->date > -1)
-            return 1;
-        else if (rep->last_modified > -1)
-            return 1;
-        else if (!_peer)
+        } else
             return 1;
 
-        /* @?@ (here and 302): invalid expires header compiles to squid_curtime */
-        else if (rep->expires > -1)
-            return 1;
-        else
-            return 0;
-
         /* NOTREACHED */
         break;