Online Book Reader

Home Category

Squid_ The Definitive Guide - Duane Wessels [121]

By Root 2048 0
to load it from disk. Squid then sent the request to the origin server as though it were a cache miss.

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.

TCP_MEM_HIT

Squid found a valid copy of the requested resource in the memory cache and sent it immediately to the client. Note that this doesn't accurately represent all responses served from memory. For example, responses that are cached in memory, but require validation, are logged with TCP_REFRESH_HIT, TCP_REFRESH_MISS, etc.

TCP_DENIED

The client's request was denied, due to either the http_access or http_reply_access rules. Note that requests denied by http_access have NONE/- in the ninth field, whereas those denied by http_reply_access have a valid entry.

TCP_OFFLINE_HIT

When offline_mode is enabled, Squid returns cache hits for almost any cached response, without considering its freshness.

TCP_REDIRECT

A redirector program told Squid to generate an HTTP redirect to a new URI (see Section 11.1). Normally, Squid doesn't log these redirects. To do so, you must manually define the LOG_TCP_REDIRECTS preprocessor directive before compiling Squid.

NONE

Unclassified result used for certain errors, such as invalid hostnames.

The following labels may appear in the fourth field of the access.log file in response to ICP queries:

UDP_HIT

Squid found a likely fresh copy of the requested resource in the cache.

UDP_MISS

Squid didn't find a likely fresh copy of the requested resource in the cache. If the same object is requested via HTTP, it would probably be a cache miss. Compare with UDP_MISS_NOFETCH.

UDP_MISS_NOFETCH

Like UDP_MISS, except that this also indicates Squid's reluctance to handle the corresponding HTTP request. If you use the -Y command-line option, Squid returns this, instead of UDP_MISS, while rebuilding its in-memory indexes at startup.

UDP_DENIED

The ICP query is denied due to the icp_access rules. If more than 95% of the ICP replies to a client are UDP_DENIED, and the client database is enabled (see Appendix A), Squid stops sending any ICP replies to the client for an hour. When this happens you'll also see a warning in cache.log.

UDP_INVALID

Squid received an invalid query (e.g., truncated message, invalid protocol version, whitespace in the URI, etc.). Squid sent an ICP_INVALID reply back to the client.

HTTP Response Status Codes

Table 13-1 lists the numerical HTTP response codes and reason phrases. Note that Squid and other HTTP agents care only about the numeric value. The reason phrase is purely informational and doesn't affect the meaning of the response. For each status code, I also provide a reference to the particular section in RFC 2616 that describes it. Note that status codes 0 and 600 are nonstandard values used by Squid, and aren't mentioned in the RFC.

Table 13-1. HTTP response status codes

Code

Reason phrase

RFC 2616 section

0

No Response Received (Squid-specific)

N/A

1xx

Informational

10.1

100

Continue

10.1.1

101

Switching Protocols

10.1.2

2xx

Successful

10.2

200

OK

10.2.1

201

Created

10.2.2

202

Accepted

10.2.3

203

Non-Authoritative Information

10.2.4

204

No Content

10.2.5

205

Reset Content

10.2.6

206

Partial Content

10.2.7

3xx

Redirection

10.3

300

Multiple Choices

10.3.1

301

Moved Permanently

10.3.2

302

Found

10.3.3

303

See Other

10.3.4

304

Not Modified

10.3.5

305

Use Proxy

10.3.6

306

(Unused)

10.3.7

307

Temporary Redirect

10.3.8

4xx

Client Error

10.4

400

Bad Request

10.4.1

401

Unauthorized

10.4.2

402

Payment

Return Main Page Previous Page Next Page

®Online Book Reader