Purgin when obj.ttl = 0
Roberto O. Fernández Crisial
roberto.fernandezcrisial at gmail.com
Fri Jun 10 18:11:19 CEST 2011
Nuno,
Once the object is purged, its TTL it set to 300s on the next request.
I think you should use something like this:
sub vcl_hit
{
if (obj.ttl < 1s)
{
purge_url(req.url);
}
}
Regards,
Roberto O. Fernández Crisial
@rofc
On Fri, Jun 10, 2011 at 1:03 PM, Nuno Neves <nfn at gmx.com> wrote:
> Hello,
>
> I run varnish 2.1 and my front page is cached for 300s.
> I would like to purge this page when the object expires.
>
> I placed this in vcl_hit:
>
> sub vcl_hit {
> if (obj.ttl < 1s) {
> set obj.ttl = 0s;
> error 200 "Purged.";
> }
> }
>
> Is this correct?
> Can obj.ttl be negative or when it's expired will be = 0?
>
> Thanks
>
> Nuno
>
> _______________________________________________
> 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/20110610/fb0efe05/attachment-0003.html>
More information about the varnish-misc
mailing list