hit for pass problems - time to change default config?
Anders Nordby
anders at fupp.net
Thu Jun 25 11:56:39 CEST 2009
Hi,
On Thu, Jun 25, 2009 at 08:42:33AM +1200, Darryl Dixon - Winterhouse Consulting wrote:
>> I am trying to set ttl before doing pass in vcl_fetch, at all places in
>> vcl_fetch where I do pass. Like for example:
>>
>> if (!beresp.cacheable) {
>> set beresp.ttl = 1200s;
>> pass;
>> }
>>
>> But still, it happens that Varnish will not cache objects, unless I
>> restart it (I waited more than the above TTL value).
> The problem is the call to 'pass'. You must not do this in vcl_fetch if
> you want Varnish to be able to cache the item. Instead, restart the
> request with 'restart'.
Thanks, I'll try that. But it leads to obscure config (just like
redirection) due to handling and taking action different places in the
config. Do we want it to be this way?
in vcl_recv:
if (req.restarts == 0) {
lookup;
} else {
pass;
}
in vcl_fetch:
if (!beresp.cacheable) {
restart;
}
If this is intended behaviour the way it should be, then at least maybe
the default configuration should be changed to reflect that pass in
vcl_fetch is bad?
Regards,
--
Anders.
More information about the varnish-misc
mailing list