Online Book Reader

Home Category

Squid_ The Definitive Guide - Duane Wessels [192]

By Root 2052 0
is similar to positive_dns_ttl, except that it applies only to failed DNS queries. That is, when Squid receives an error for a DNS lookup, it negatively caches the error for this amount of time. It doesn't retry the query until the negative TTL expires. This applies to both internal and external DNS implementation choices.

Syntax

negative_dns_ttl time-specification

Default

negative_dns_ttl 5 minutes

Example

negative_dns_ttl 1 minute

Related

positive_dns_ttl

Name

range_offset_limit

Synopsis

A range request comes from a client that wants only some subset of an HTTP response. They are sometimes used to resume a failed transfer of a large file. Squid isn't yet able to cache partial responses and thus must make a decision when forwarding a range request: either remove the Range header or leave it in.

If Squid leaves the Range header in, the origin server sends only the subset that the client wants, and the client receives the response immediately. However, this partial response isn't cached.

On the other hand, if Squid removes the header before forwarding, it receives the entire response, which may be cached. Squid is then responsible for ensuring that the client receives only the subset it needs. The origin server may send a lot of data the client doesn't want. Depending on the speed of your connection, the client may be forced to wait a long time until its range is available.

If the beginning of the requested range is larger than the range_offset_limit value, Squid forwards the Range header and doesn't cache the response. Setting range_offset_limit to 0 causes Squid to always forward the Range header (the default). Setting it to -1 causes Squid to never forward the header.

Syntax

range_offset_limit size-specification

Default

range_offset_limit 0 KB

Example

range_offset_limit 100 KB

Name

connect_timeout

Synopsis

This directive tells Squid how long to wait when trying to connect to an origin server. After this amount of time, Squid gives up and tries another location or returns an error to the user. Your operating system's TCP implementation has its own connection timeout. If the TCP timeout occurs before connect_timeout, Squid creates a new TCP connection and tries again.

Syntax

connect_timeout time-specification

Default

connect_timeout 2 minutes

Example

connect_timeout 30 seconds

Related

peer_connect_timeout, read_timeout, write_timeout, request_timeout, pconn_timeout, minimum_retry_timeout

Name

peer_connect_timeout

Synopsis

This is similar to connect_timeout, except that it applies to connections to your neighbors. Most likely, you'll want a smaller timeout for neighbor connections because they should be closer to you than most origin servers. If a neighbor is down, you want the connection to time out quickly so that you can try another source. Note that you can also specify individual neighbor timeouts with the connect-timeout option of the cache_peer directive.

Syntax

peer_connect_timeout time-specification

Default

peer_connect_timeout 30 seconds

Example

peer_connect_timeout 15 seconds

Related

connect_timeout

Name

read_timeout

Synopsis

This timeout applies to server connections (between Squid and origin servers or neighbor caches). If Squid doesn't receive any data for this amount of time, it closes the connection. If the user hasn't yet received any part of the response, Squid generates a "read timeout" error message.

Syntax

read_timeout time-specification

Default

read_timeout 15 minutes

Example

read_timeout 1 hour

Related

connect_timeout, write_timeout, request_timeout, client_lifetime

Name

request_timeout

Synopsis

This timeout applies to client connections. Once a client establishes a connection, Squid waits this long to receive the client's HTTP request. If the client fails to send a complete request, Squid simply closes the connection without sending any error message.

Syntax

request_timeout time-specification

Default

request_timeout 5 minutes

Example

request_timeout 30 seconds

Return Main Page Previous Page Next Page

®Online Book Reader