Varnish Cache Clears

Updated . Posted . Visible to the public.

Clear for an entire domain:

varnishadm "ban req.http.host == www.mydomain.com"

Clear for a URL on a domain that starts with something, or ends with something (just regex, so change as you like):

varnishadm "ban req.http.host == www.mydomain.com && req.url ~ ^/some-directory"
varnishadm "ban req.http.host == www.mydomain.com && req.url ~ .css$"

Clear for a specific URL:

varnishadm "ban req.http.host == www.mydomain.com && req.url == /some/specific/url"

Here is a nice cheatsheet for ya - http://kly.no/varnish/regex.txt Show archive.org snapshot

Mike Whitby
Last edit
Keywords
ban
Posted by Mike Whitby to Magento (2014-05-16 15:43)