<div class="gmail_quote">On Mon, Jul 11, 2011 at 09:39, Tollef Fog Heen <span dir="ltr"><<a href="mailto:tfheen@varnish-software.com">tfheen@varnish-software.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

]] Scott Wilcox<br>
<div class="im"><br>
| 2) I want to do something similar to:<br>
|<br>
| sub vcl_hit {<br>
|       set obj.http.X-Cache-Hit = "true";<br>
|       return (deliver);<br>
| }<br>
| sub vcl_miss {<br>
|       set obj.http.X-Cache-Hit = "false";<br>
|       return (fetch);<br>
| }<br>
|<br>
| for debugging purposes, however when I add that to a VCL, I get:<br>
|<br>
| Message from VCC-compiler:<br>
| 'obj.http.X-Cache-Hit': cannot be set in method 'vcl_hit'.<br>
<br>
</div>do something like:<br>
<br>
sub vcl_deliver {<br>
    if (obj.hits > 1) {<br>
        set resp.http.X-Cache-Hit = "true";<br>
    } else {<br>
        set resp.http.X-Cache-Hit = "false";<br>
    }<br>
}<br>
<br></blockquote><div><br>Shouldn't it be obj.hits > 0?<br><br>Scott read this about adding the header: <a href="https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader">https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader</a><br>

<br>Greetings.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Regards,<br>
<font color="#888888">--<br>
Tollef Fog Heen<br>
Varnish Software<br>
t: <a href="tel:%2B47%2021%2098%2092%2064" value="+4721989264">+47 21 98 92 64</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Jorge Nerín<br><<a href="mailto:jnerin@gmail.com">jnerin@gmail.com</a>><br>