<<Back

OPTIONS FOR TUNING THE CACHE

Tag Namewais_relay_host
wais_relay_port
Usage

wais_relay_host
wais_relay_port

Description
Relay WAIS request to host (1st arg) at port (2 arg).

Defaultwais_relay_port 0

Example
wais_relay_host localhost
wais_relay_port 8000

 

Tag Namerequest_header_max_size
Usagerequest_header_max_size (KB)

Description
This specifies the maximum size for HTTP headers in a request. Request headers are usually relatively small (about 512 bytes). Placing a limit on the request header size will catch certain bugs (for example with persistent connections) and possibly buffer-overflow or denial-of-service attacks.

Defaultrequest_header_max_size 10 KB

 

Tag Namerequest_body_max_size
Usagerequest_body_max_size (KB)

Description
This specifies the maximum size for an HTTP request body. In other words, the maximum size of a PUT/POST request. A user, who attempts to send a request with a body larger than this limit receives an "Invalid Request" error message. If you set this parameter to a zero, there will be no limit imposed.

Defaultrequest_body_max_size 1 MB

 

Tag Namereply_body_max_size
Usagereply_body_max_size (KB)

Description
This option specifies the maximum size of a reply body. It can be used to prevent users from downloading very large files, such as MP3's and movies. The reply size is checked twice. First when we get the reply headers, we check the content-length value. If the content length value exists and is larger than this parameter, the request is denied and the user receives an error message that says "the request or reply is too large." If there is no content-length, and the reply size exceeds this limit, the client's connection is just closed and they will receive a partial reply.

Defaultreply_body_max_size 0
If this parameter is set to zero (the default), there will be no limit imposed.

Caution
Downstream caches probably cannot detect a partial reply if there is no content-length header, so they will cache partial responses and give them out as hits. You should NOT use this option, if you have downstream caches.

 

Tag Namerefresh_pattern
Usagerefresh_pattern [-i] regex min percent max [options]

Description
'Min' is the time (in minutes) an object without an explicit expiry time should be considered fresh. The recommended value is 0; any higher values may cause dynamic applications to be erraneously cached unless the application designer has taken the appropriate actions.

'Percent' is a percentage of the objects age (time since last modification age) an object without explicit expiry time will be considered fresh.

'Max' is an upper limit on how long objects without an explicit expiry time will be considered fresh.

Options:

override-expire
override-lastmod
reload-into-ims
ignore-reload

override-expire enforces min age even if the server sent a Expires: header. Doing this VIOLATES the HTTP standard. Enabling this feature could make you liable for problems, which it causes.

override-lastmod enforces min age even on objects that was modified recently.

reload-into-ims changes client no-cache or ``reload'' to If-Modified-Since requests. Doing this VIOLATES the HTTP standard. Enabling this feature could make you liable for problems, which it causes.


ignore-reload ignores a client no-cache or ``reload'' header. Doing this VIOLATES the HTTP standard. Enabling this feature could make you liable for problems, which it causes.


Basically a cached object is: (the order is changed from 1.1.X)

FRESH if expiresbr>STALE if age >max
FRESH if lm-factorbr>STALE FRESH if age
else STALE

The refresh_pattern lines are checked in the order listed here. The first entry which matches is used. If none of the entries match, then the default will be used.

Default

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

 

Tag Namereference_age
Usagereference_age time-units

Description
As a part of normal operation, Squid performs Least Recently Used removal of cached objects. The LRU age for removal is computed dynamically, based on the amount of disk space in use. The dynamic value can be seen in the Cache Manager 'info' output.

The 'reference_age' parameter defines the maximum LRU age

Defaultreference_age 1 year

Example
For example, setting reference_age to '1 week' will cause objects to be removed, if they have not been accessed for a week or more. The default value is one year.

Specify a number here, followed by units of time. For example:

1 week
3.5 days
4 months
2.2 hours

Caution
This parameter is not used when using the enhanced replacement policies, GDSH or LFUDA.

 

Tag Namequick_abort_min
quick_abort_max
quick_abort_pct
Usage

quick_abort_min (KB)
quick_abort_max (KB)
quick_abort_pct (percent)

Description
The cache can be configured to continue downloading aborted requests. This may be undesirable on slow (e.g. SLIP) links and/or very busy caches. Impatient users may tie up file descriptors and bandwidth by repeatedly requesting and immediately aborting downloads.

When the user aborts a request, Squid will check the quick_abort values to the amount of data transferred until then.

If the transfer has less than 'quick_abort_min' KB remaining, it will finish the retrieval. Setting 'quick_abort_min' to –1 will disable the quick_abort feature.

If the transfer has more than 'quick_abort_max' KB remaining, it will abort the retrieval.

If more than 'quick_abort_pct' of the transfer has completed, it will finish the retrieval.

Default

quick_abort_min 16 KB
quick_abort_max 16 KB
quick_abort_pct 95

Caution
This may be undesirable on slow (e.g. SLIP) links and/or very busy caches.

 

Tag Namenegative_ttl
Usagenegative_ttl time-units

Description
Time-to-Live (TTL) for failed requests. Certain types of failures (such as "connection refused" and "404 Not Found") are negatively-cached for a configurable amount of time. Note that, this is different from negative caching of DNS lookups.

Default

The default is 5 minutes.

negative_ttl 5 minutes

 

Tag Namepositive_dns_ttl
Usagepositive_dns_ttl time-units

Description
Time-to-Live (TTL) for positive caching of successful DNS lookups. If you want to minimize the use of Squid's ipcache, set this to 1, not 0.

Default

Default is 6 hours (360 minutes).

positive_dns_ttl 6 hours

 

Tag Namenegative_dns_ttl
Usagenegative_dns_ttl time-units

Description
Time-to-Live (TTL) for negative caching of failed DNS lookups

Default

negative_dns_ttl 5 minutes

 

Tag Namerange_offset_limit
Usagerange_offset_limit (bytes)

Description
Sets an upper limit on how far into the file a Range request may be to cause Squid to prefetch the whole file. If beyond this limit, then Squid forwards the Range request as it is and the result is NOT cached.

This is to stop a far ahead range request (lets say start at 17MB) from making Squid fetch the whole object up to that point before sending anything to the client.

A value of -1 causes Squid to always fetch the object from the beginning so that it may cache the result. (2.0 style).

A value of 0 causes Squid to never fetch more than the client requested. (default) .

Defaultrange_offset_limit 0 KB

 

<<Back
 

All rights reserved.
All trademarks used in this document are owned by their respective companies. This document makes no ownership claim of any trademark(s). If you wish to have your trademark removed from this document, please contact the copyright holder. No disrespect is meant by any use of other companies’ trademarks in this document.
Note: The pages on this website cannot be duplicated on to another site. Copying and usage of the contents for personal and corporate purposes is acceptable. In near future, it will be released under the GNU Free Documentation License.
© ViSolve.com 2002 
Created By: squid@visolve.comDate: May 15,2002
Revision No:0.0 
Modified ByDate