varnish storage tuning

Darryl Dixon - Winterhouse Consulting darryl.dixon at winterhouseconsulting.com
Fri Jun 12 01:29:12 CEST 2009


Hi Mike,

Yes. If all you want to do is just get rid of the object, then all you
need to do is set obj.ttl = 0 (as per your example below). In my case I
wanted to honour the Cache-Control: no-cache header, which involved
re-fetching the object from the backend. If you simply want to remove the
item, then definitely you don't need to restart.

regards,
Darryl Dixon
Winterhouse Consulting Ltd
http://www.winterhouseconsulting.com

> Does restart cause the backend to be queried for the page again?  I'd
> prefer
> if a purge did not re-fetch the URL from the backend as this can caused
> unwanted content to stay in the cache and my cache is relatively limited
> in
> size.  Can I do something like:
> sub vcl_hit {
>     if (req.request == "PURGE") {
>         set obj.ttl = 0;
>         error 200 "Purged";
>     }
> }
>
> sub vcl_miss {
>     if (req.request == "PURGE") {
>         error 200 "Purged (not in cache)";
>     }
> }
>
>
> On Thu, Jun 11, 2009 at 4:46 PM, Darryl Dixon - Winterhouse Consulting <
> darryl.dixon at winterhouseconsulting.com> wrote:
>
>>
>> Instead, in vcl_hit, if the object should be purged, set obj.ttl to 0
>> and
>> then restart the request. This solved the problem for me.
>>
>>
>



More information about the varnish-misc mailing list