Clear all the cache of a domain

Abraham Cruz Sustaita abraham.sustaita at buscacorp.com
Fri Jun 15 02:34:25 CEST 2012


I use this class PHP (http://varnish-cache.org/wiki/CLI) to clean the
Varnish cache, I only do this:

$var01Obj = new Varnish('192.168.11.41', 6082, 3);
$var01Obj->set_auth('XXXXXXXXXXXX' . "\n");
$ret = $var01Obj->connect();
if ($ret['status']) {
 print_r($var01Obj->purge_url($url));
} else {
print_r($ret);
}

where $url is an url of the form ^/news/$ but I have a problem and I need
to delete all the cache of a site, let say, I have www.site.com/news/ and
the news are www.site.com/news/1/title/ and I have 5,000 news, but also I
have other site www.other-site.com with the same friendly urls, so I only
need to clean the cache for www.site.com not for www.other-site.com. If I
make

$url = '^www.site.com.*&';

will it work?

I know ^/news.*$ works since I have some rules like that (for comments for
example), but I have no idea if it will work using the full domain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120614/0a7c5bf8/attachment.html>


More information about the varnish-misc mailing list