TCP_HIT header

JT Justman jt at endpoint.com
Wed Nov 5 22:42:43 CET 2008


Alecs Henry wrote:
> Hi Per,
> 
> Here's what I got:
> -------------
> vcl.load test /usr/local/etc/varnish/configs/test.vcl
> 106 267    
> *Variable 'obj.http.X-Cache' not accessible in method 'vcl_miss'.*
> At: (/usr/local/etc/varnish/configs/test.vcl Line 62 Pos 13)
>         set obj.http.X-Cache = "TCP_MISS from " server.ip;
> ------------################------------------------------
> VCL compilation failed
> -------------
> 
> It works just fine for vcl_hit though.
> Any ideas?
> 

'obj' is only available in 'hit' and 'fetch'. So set it in vcl_fetch.
The only side effect being then your header will be set in the case of a
'pass' as well, which may or may not be what you want.

-- 
jt at endpoint.com
http://www.endpoint.com



More information about the varnish-misc mailing list