RE: [squid-users] How to disable TCP_NEGATIVE_HIT?

From: xufeng <xufeng_at_yuanjie.net>
Date: Thu, 24 Jul 2008 09:04:40 +0800

Hi

As feedback, it works fine with the solution.

In the access.log, the original
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
Is now
222.xx.yy.zz - - [23/Jul/2008:15:10:30 +0800] "GET http://www. example.com/
HTTP/1.1" 503 631 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;
SV1; .NE
T CLR 1.1.4322)" TCP_MISS:FIRST_UP_PARENT

TCP_NEGATIVE_HIT --> TCP_MISS

-----Original Message-----
From: Amos Jeffries [mailto:squid3_at_treenet.co.nz]
Sent: 2008Äê7ÔÂ23ÈÕ 12:16
To: xufeng
Cc: squid-users_at_squid-cache.org
Subject: Re: [squid-users] How to disable TCP_NEGATIVE_HIT?

> 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
Received on Thu Jul 24 2008 - 01:04:33 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 24 2008 - 12:00:04 MDT