cache purging questions

Stig Sandbeck Mathisen ssm at fnord.no
Tue Jun 9 20:55:33 CEST 2009


Matthew Hoopes <matthew.hoopes at gmail.com> writes:

> I've tried a whole gang of regular expressions involving backslashes
> and .* everywhere, but I get either "Syntax Error: Illegal backslash
> sequence" or it just doesn't clear the cache of the objects i'm trying
> to clear.
>
> Is it even possible to clear the cache based on hostname?

yes, see below.

> If someone could show me an example of how to clear the cache of every
> object from a domain (if possible) i'd be very grateful.

When I do "varnishadm -T localhost:6082 help", the "url.purge" mentioned
in varnishd(1) is not visible, but rather a group of commands starting
with "purge"

After a minute of testing:

varnishadm -T localhost:6082 \
 'purge req.http.host == "www.example.org" && req.url ~ /foo|bar/'

...neat.

varnishadm -T localhost:6082 'purge.list'

...even more neat :)

This is on varnishd 2.0.4, by the way.  

-- 
Stig Sandbeck Mathisen




More information about the varnish-misc mailing list