Hi Per,<br><br>Here's what I got:<br>-------------<br>vcl.load test /usr/local/etc/varnish/configs/test.vcl<br>106 267 <br><b>Variable 'obj.http.X-Cache' not accessible in method 'vcl_miss'.</b><br>
At: (/usr/local/etc/varnish/configs/test.vcl Line 62 Pos 13)<br> set obj.http.X-Cache = "TCP_MISS from " server.ip;<br>------------################------------------------------<br>VCL compilation failed<br>
-------------<br><br>It works just fine for vcl_hit though.<br>Any ideas?<br><br>Alecs<br><br><div class="gmail_quote">On Wed, Nov 5, 2008 at 3:59 PM, Per Buer <span dir="ltr"><<a href="mailto:perbu@linpro.no">perbu@linpro.no</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi.<br>
<br>
As I said. Add two different headers. One you add in vcl_hit and one<br>
(preferably a different one) in vcl_miss. You need no variables. The<br>
code in vcl_hit will be run for a hit and vcl_miss will be run for a miss.<br>
<br>
Check out the getting started guide, the FAQ and the VCL-page on Wiki if<br>
you seek documentation. Thats all there is, at the moment.<br>
<br>
Per.<br>
<br>
<br>
<br>
<br>
Alecs Henry skrev:<br>
<div class="Ih2E3d">> Hi Per,<br>
> Thanks for the reply!<br>
><br>
> The issue here is not how to add the header, that is OK, I can do it<br>
> just fine (even added the Foo: bar header just for the fun of it!). The<br>
> problem is WHAT variable I can use that contains that information (MISS<br>
> or HIT).<br>
> Is there more documentation on the variables available than what is in<br>
> vcl(7)?<br>
> Or anywhere else for that matter.<br>
><br>
> Thanks,<br>
><br>
> Alecs<br>
><br>
> On Wed, Nov 5, 2008 at 3:10 PM, Per Buer <<a href="mailto:perbu@linpro.no">perbu@linpro.no</a><br>
</div><div class="Ih2E3d">> <mailto:<a href="mailto:perbu@linpro.no">perbu@linpro.no</a>>> wrote:<br>
><br>
> Alecs Henry skrev:<br>
> > Hi guys,<br>
> ><br>
> > Is there a variable that I can print on the response header that will<br>
> > give me the cache lookup result such as TCP_HIT or TCP_MISS?<br>
><br>
> I guess you can add the relevant header in vcl_hit and vcl_miss<br>
><br>
> See the FAQ:<br>
> <a href="http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader" target="_blank">http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader</a><br>
><br>
> Just add a<br>
> sub vcl_hit {<br>
> # add code from faq here<br>
> }<br>
><br>
><br>
><br>
> --<br>
> <a href="http://linpro.no/" target="_blank">http://linpro.no/</a> | <a href="http://redpill.se/" target="_blank">http://redpill.se/</a><br>
><br>
><br>
<br>
<br>
</div><font color="#888888">--<br>
Per Buer - Leder Infrastruktur og Drift - Redpill Linpro<br>
Telefon: 21 54 41 21 - Mobil: 958 39 117<br>
</font><div><div></div><div class="Wj3C7c"><a href="http://linpro.no/" target="_blank">http://linpro.no/</a> | <a href="http://redpill.se/" target="_blank">http://redpill.se/</a><br>
<br>
</div></div></blockquote></div><br>