Cache invalidation (not PURGE)

Laurence Rowe l at lrowe.co.uk
Wed Jan 20 23:18:34 CET 2010


2010/1/19 Antoni Villalonga <antonivillalonga at dorna.com>:
> Hi!
>
> I'm looking for a method to invalidate some url.
> http://example.com/invalidate.html, for example.
>
> If I PURGE using 'purge()' function and 2 diferent users GET
> "http://example.com/invalidate.html" at time, varnish ask for the url to the
> backend server twice.
>
> When a url cache expires, and 2 diferent users GET the url at time, varnish ask
> only one time to the backend and serve an expired version to the "second" user.
> (yes, we use "grace time").
>
> In short, I also want to use "grace time" when urls are "purged".

There are two ways to invalidate objects, purge(expression); and set
obj.ttl = 0; If you use the second form you should get the behaviour
you want. Note that if you use Vary: you must purge each vary with a
separate request.

http://varnish.projects.linpro.no/wiki/VCLExamplePurging

Laurence



More information about the varnish-misc mailing list