A Few Questions

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Jul 9 23:57:11 CEST 2011

In message <FCB52A10-6AD5-4658-9E37-5D629250A2BC at dor.ky>, Scott Wilcox writes:

>1) Can listening host/port be set in the VCL?

No, but you can set it from the CLI.

>sub vcl_hit {
>	set obj.http.X-Cache-Hit = "true";
> [...]
>Message from VCC-compiler:
>'obj.http.X-Cache-Hit': cannot be set in method 'vcl_hit'.

And it's right:  You don't have an object to modify at that
point.  Set req.http.X-Cache-Hit instead and copy that to
the response in vcl_deliver{}

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list