Clear all the cache of a domain

Paul A. Procacci pprocacci at datapipe.com
Fri Jun 15 03:14:33 CEST 2012


Not sure of the capabilities of the class you are using, but you can ban url's
based on req.http.host and the passed url.

ban req.http.host == "example.com" && req.url ~ "/news/.*"

^^ for example.

~Paul


On Thu, Jun 14, 2012 at 05:34:25PM -0700, Abraham Cruz Sustaita wrote:
>    I use this class PHP ([1]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
>    [2]www.site.com/news/ and the news are [3]www.site.com/news/1/title/
>    and I have 5,000 news, but also I have other site [4]www.other-site.com
>    with the same friendly urls, so I only need to clean the cache for
>    [5]www.site.com not for [6]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
>
> References
>
>    1. http://varnish-cache.org/wiki/CLI
>    2. http://www.site.com/news/
>    3. http://www.site.com/news/1/title/
>    4. http://www.other-site.com/
>    5. http://www.site.com/
>    6. http://www.other-site.com/

> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

________________________________

This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.



More information about the varnish-misc mailing list