Cache invalidation with regex
infos at opendoc.net
Fri Dec 6 16:12:13 CET 2013
I found a solution using directly varnishadm. I wanted to invalidate an
entire url :
With this command :
varnishadm "ban.url var=1"
I can invalidate the cache of 3 url.
On 29/11/13 14:18, Alexandre wrote:
> Thank you very much. This is exactly what I want. I'll try to test the
> script in the day.
> Good day.
> On 29/11/13 13:49, Cosimo Streppone wrote:
>> On 11/29/2013 11:01 AM, Geoff Simmons wrote:
>>> On 11/28/2013 06:29 PM, Alexandre wrote:
>>>> I will wish to invalidate my cache using a regex.
>>>> example: ^/image.php?a=1&b=2*
>>>> I would like to disable all url starting with ^/image.php?a=1&b=2
>>>> Do you have an idea for my problem?
>>> The '*' in a regular expression is not like a file glob, it means that
>>> the character before it, in your case the '2', can appear 0 or more
>>> So your regex matches anything starting with:
>> I made a simple shell script wrapper to the varnish admin.
>> It is available here:
>> If you run it with:
>> $ ./purge-cache.sh -h
>> it will show some usage instructions.
>> In particular:
>> $ ./purge-cache -r '^/image\.php\?a=1&b=2.*'
>> should purge the URLs you asked for.
>> It worked for me at least, and I added
>> to my varnish puppet module, to always have it available
>> alongside reload-vcl etc...
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
More information about the varnish-misc