Re: [squid-users] Force page refresh

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 16 Feb 2011 12:03:09 +1300

 On Tue, 15 Feb 2011 11:18:38 -0800, Andy Nagai wrote:
> Is there any way to force cache refresh of a specific cached page or
> specific javascript or css file?

 Usually yes. There is one case when its not: a remote visitor
 attempting to force-refresh a hardened reverse-proxy.

 * The client can send no-cache, max-age=0 or must-revalidate in its
 request headers. Any one of which will force revalidation and update of
 the cached object. Although you need to be careful that the variant
 headers match between the new request and what is cached.

 * The server can also start sending no-cache, max-age=0, no-store or
 private in the Cache-Control: headers or an Expires: in the past. The
 next validation will currently erase cached versions of the objects.
 This is technically an HTTP loophole so will not always be the case, but
 it works for squid-3.1 and older.

 * If HTCP protocol is enabled an HTCP CLR message can be sent to the
 proxy. This will update all HTCP-enabled peers as well with one UDP
 packet. The next client request will pull a fresh copy into cache.

 * If PURGE method is explicitly configured a PURGE request can be sent
 to the proxy. Again the variant headers MUST match between the request
 and the cached object. The next client request will pull a fresh copy
 into cache. (HTCP CLR is far better if you can)

>
> Is there a way to clear out the cache completely from a web
> interface?
>

 No. Clearing the cache is a last-resort action when things go
 completely bad. This is an admin task which is a bad idea to allow
 people to perform trivially.

 When configured to permit PURGE requests Squid will accept them and
 remove the cached entry matching the given URL and any variant headers
 in the request (other variants may be left in cache but inaccessible).
 This can be repeated for every URL in the cache.

 That said, requests like yours are often made by admin with bad
 configurations and/or old versions of Squid. If it is your own Squid
 check that squid is obeying the HTTP cache-control headers (not
 violating them with refresh_pattern to forcing things to stay cached
 beyond their valid lifetime). Also we have an old and ongoing effort to
 improve the caching, using a recent version is important for best HTTP
 compliance.

 Amos
Received on Tue Feb 15 2011 - 23:03:13 MST

This archive was generated by hypermail 2.2.0 : Wed Feb 16 2011 - 12:00:03 MST