Is there a way to invalidate a cached item on multiple varnish servers at once?

Dridi Boukelmoune dridi.boukelmoune at zenika.com
Tue Oct 1 10:47:23 CEST 2013


Well, this is a bit twisted, but you could have your varnish instances
as back-ends of themselves, and with the use of PURGE/BAN methods,
add a restart logic that would push the invalidation request to the next
varnish.

Example:
V1 -> B1
V2 -> B2
V3 -> B3

Your back-ends B1 to B3 could purge their respective varnish
instances. The purge request would be first interpreted and then
restarted to use another Varnish as the backend:
V1 -> V2 -> V3 -> V1

With the proper use of a guard variable, probably a [be]req header,
you can propagate the invalidation without falling into an infinite
loop. But this is just theory, I wouldn't go down that path :p

I haven't heard of any tool doing general-purpose http replication (or
multiple forwarding), but in the Varnish ecosystem, the super fast
purger is probably what you're looking for.

Regards,
Dridi

On Tue, Oct 1, 2013 at 9:40 AM, Rainer Duffner <rainer at ultra-secure.de> wrote:
> Am Mon, 30 Sep 2013 13:44:34 -0700
> schrieb James Pearson <james at ifixit.com>:
>
>> Excerpts from Rainer Duffner's message of 2013-09-29 13:45:51 -0700:
>> > Hi,
>> >
>> > suppose you've got a couple of load-balanced varnish-servers, is
>> > there a way to have an item removed from the cache on multiple
>> > servers at the same time?
>>
>> How small of a window do you need?  I'd probably just fire off a
>> PURGE request to each server, but that'd give a few seconds where
>> some servers would have a cache entry and others would not.
>
> It's not a question of a certain time-window.
> More a question of transparency.
> E.g. in Drupal, you can only enter a single IP.
>
> It's unreasonable to assume a user would be able to issue a purge on a
> 2nd (or 3rd) server himself - as he may not know the IPs of these
> servers anyway.
>
>
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list