Squid configuration directive refresh_pattern

Available in: 3.3   3.2   3.1   2.7   3.HEAD   2.HEAD   3.0   2.6  

History:

Changes in 3.3 refresh_pattern

stale-while-revalidate= not yet ported from 2.7

ignore-stale-while-revalidate= not yet ported from 2.7

negative-ttl= not yet ported from 2.7

Changes in 3.2 refresh_pattern

New option max-stale= to provide a maximum staleness factor. Squid won't serve objects more stale than this even if it failed to validate the object.

Removed option ignore-no-cache. Its commonly desired behaviour is obsoleted by correct HTTP/1.1 Cache-Control:no-cache handling.

Changes in 3.1 refresh_pattern

New option 'ignore-must-revalidate'.

        ignore-must-revalidate ignores any ``Cache-Control: must-revalidate``
        headers received from a server. Doing this VIOLATES
        the HTTP standard. Enabling this feature could make you
        liable for problems which it causes.
        

New set of basic patterns. These should always be listed after any custom patterns. They ensure RFC compliance with certain protocol and request handling in the absence of accurate Cache-Control: and Expires: information.

refresh_pattern ^ftp:             1440   20%    10080
refresh_pattern ^gopher:          1440    0%     1440
refresh_pattern -i (/cgi-bin/|\?)    0    0%        0
refresh_pattern .                    0   20%     4320
        

Changes in 2.7 refresh_pattern

Several new options: stale-while-revalidate, ignore-stale-while-revalidate, max-stale, negative-ttl

Suggested defaults adjusted to match the changes in the cache directive.

Changes in 3.HEAD refresh_pattern

stale-while-revalidate= not yet ported from 2.7

ignore-stale-while-revalidate= not yet ported from 2.7

negative-ttl= not yet ported from 2.7

Changes in 3.0 refresh_pattern

New options:

    ignore-no-store
    refresh-ims

    ignore-no-store ignores any ``Cache-control: no-store''
    headers received from a server. Doing this VIOLATES
    the HTTP standard. Enabling this feature could make you
    liable for problems which it causes.

    refresh-ims causes squid to contact the origin server
    when a client issues an If-Modified-Since request. This
    ensures that the client will receive an updated version
    if one is available.
        

Changes in 2.6 refresh_pattern

Several new HTTP override/ignore options

Configuration Details:

Option Name:refresh_pattern
Replaces:
Requires:
Default Value:none
Suggested Config:

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern .		0	20%	4320

	usage: refresh_pattern [-i] regex min percent max [options]

	By default, regular expressions are CASE-SENSITIVE.  To make
	them case-insensitive, use the -i option.

	'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 erroneously 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
		 ignore-no-store
		 ignore-must-revalidate
		 ignore-private
		 ignore-auth
		 max-stale=NN
		 refresh-ims
		 store-stale

		override-expire enforces min age even if the server
		sent an explicit expiry time (e.g., with the
		Expires: header or Cache-Control: max-age). Doing this
		VIOLATES the HTTP standard.  Enabling this feature
		could make you liable for problems which it causes.

		Note: override-expire does not enforce staleness - it only extends
		freshness / min. If the server returns a Expires time which
		is longer than your max time, Squid will still consider
		the object fresh for that period of time.

		override-lastmod enforces min age even on objects
		that were 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.

		ignore-no-store ignores any ``Cache-control: no-store''
		headers received from a server. Doing this VIOLATES
		the HTTP standard. Enabling this feature could make you
		liable for problems which it causes.

		ignore-must-revalidate ignores any ``Cache-Control: must-revalidate``
		headers received from a server. Doing this VIOLATES
		the HTTP standard. Enabling this feature could make you
		liable for problems which it causes.

		ignore-private ignores any ``Cache-control: private''
		headers received from a server. Doing this VIOLATES
		the HTTP standard. Enabling this feature could make you
		liable for problems which it causes.

		ignore-auth caches responses to requests with authorization,
		as if the originserver had sent ``Cache-control: public''
		in the response header. Doing this VIOLATES the HTTP standard.
		Enabling this feature could make you liable for problems which
		it causes.

		refresh-ims causes squid to contact the origin server
		when a client issues an If-Modified-Since request. This
		ensures that the client will receive an updated version
		if one is available.

		store-stale stores responses even if they don't have explicit 
		freshness or a validator (i.e., Last-Modified or an ETag) 
		present, or if they're already stale. By default, Squid will 
		not cache such responses because they usually can't be
		reused. Note that such responses will be stale by default.

		max-stale=NN provide a maximum staleness factor. Squid won't
		serve objects more stale than this even if it failed to
		validate the object. Default: use the max_stale global limit.

	Basically a cached object is:

		FRESH if expires < now, else STALE
		STALE if age > max
		FRESH if lm-factor < percent, else STALE
		FRESH if age < min
		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 the default will be used.

	Note, you must uncomment all the default lines if you want
	to change one. The default setting is only active if none is
	used.


 

Back

Search

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors