Nuno,<div><br></div><div>Once the object is purged, its TTL it set to 300s on the next request.</div><div><br></div><div>I think you should use something like this:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; "><div>
sub vcl_hit</div><div>{</div><div> if (obj.ttl < 1s)</div><div> {</div><div> purge_url(req.url);</div><div> }</div><div>}</div><div><br></div></span></div><div>Regards,</div><div>Roberto O. Fernández Crisial</div>
<div>@rofc<br><br><div class="gmail_quote">On Fri, Jun 10, 2011 at 1:03 PM, Nuno Neves <span dir="ltr"><<a href="mailto:nfn@gmx.com">nfn@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="font-family:Verdana"><span style="font-size:12px">Hello,<br>
<br>
I run varnish 2.1 and my front page is cached for 300s.<br>
I would like to purge this page when the object expires.<br>
<br>
I placed this in vcl_hit:<br>
<br>
<div>
sub vcl_hit {</div>
<div>
if (obj.ttl < 1s) {</div>
<div>
set obj.ttl = 0s;</div>
<div>
error 200 "Purged.";</div>
<div>
}</div>
<div>
}<br>
<br>
Is this correct?<br>
Can obj.ttl be negative or when it's expired will be = 0?<br>
<br>
Thanks<br><font color="#888888">
<br>
Nuno</font></div>
</span></span>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br></div>