> Hi Squid Users, > > I use squid to accelerate my website, for example www.example.com. In the > access.log, I found such > > 222.xx.yy.zz - - [22/Jul/2008:15:02:26 +0800] "GET http://www.example.com/ > HTTP/1.1" 503 858 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; > .NET CLR 1.1.4322)" TCP_NEGATIVE_HIT:NONE > > Though I am sure that the backend web server is up and can provide > service, > still the browser got 503 Service Unavailable error display. > > I check the book 'Squid: The definitive guide', and found > > TCP_NEGATIVE_HIT > When a request to an origin server results in an HTTP error, Squid > may cache the response anyway. Repeated requests for these resources, > within > a short amount of time, result in negative hits. The negative_ttl > directive > controls the amount of time these errors may be cached. Also note that > errors are cached only in memory and never written to disk. The following > HTTP status codes may be negatively cached, subject to additional > constraints: 204, 305, 400, 403, 404, 405, 414, 500, 501, 502, 503, 504. > > In Squid 2.6 configuration manual, it says, we can use negative_ttl to > control Time-to-Live (TTL) for failed requests. > > My question is ,can we use > negative_ttl 0 > to disable caching of failed requests, so the following visitors will not > get the TCP_NEGATIVE_HIT responses? Yes, mostly. With 0, the TTL will be whatever expiry info the web server places into the 404 pages. But it is assumed to be none if absent. Amos