Varnish Purging with URL in browser

Roberto O. Fernández Crisial roberto.fernandezcrisial at gmail.com
Wed Apr 20 22:43:56 CEST 2011


Hi!

I think you're looking for something like this, in your VCL (vcl_recv):

        if (req.url ~ ".*\?purge=true$")
        {
                set req.http.X-Purge = regsub( req.url, "(.*)\?purge=true$",
"\1" );
                purge_url(req.http.X-Purge);
        }

I hope this helps you!

Regards,
Roberto O. Fernández Crisial.
@rofc

On Wed, Apr 20, 2011 at 5:24 PM, Varnish List <varnishlist at realvideosite.com
> wrote:

> I am trying to figure out if it is at all possible to purge objects in the
> varnish cache through the URL in the browser.
>
> I have been able to purge using curl -X and the CLI but, say you have an
> object called image.jpg and you want to open your browser and type:
>
>  http://www.domain.com/images/image.jpg?purge=true
>
> In order to purge it ( TTL=0 ). Is this possible to do? Can it be
> implemented with VCL? If you know of a way to handle this please let me
> know.
>
> I'm somewhat convinced it can be done because it was mentioned here:
> http://kristianlyng.wordpress.com/2010/07/15/varnish-crash-course-for-sysadmins
>
> Thanks!!!
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110420/e4249047/attachment-0003.html>


More information about the varnish-misc mailing list