A Few Questions

Jorge Nerín jnerin+varnish at gmail.com
Mon Jul 11 10:37:57 CEST 2011


On Mon, Jul 11, 2011 at 09:39, Tollef Fog Heen
<tfheen at varnish-software.com>wrote:

> ]] Scott Wilcox
>
> | 2) I want to do something similar to:
> |
> | sub vcl_hit {
> |       set obj.http.X-Cache-Hit = "true";
> |       return (deliver);
> | }
> | sub vcl_miss {
> |       set obj.http.X-Cache-Hit = "false";
> |       return (fetch);
> | }
> |
> | for debugging purposes, however when I add that to a VCL, I get:
> |
> | Message from VCC-compiler:
> | 'obj.http.X-Cache-Hit': cannot be set in method 'vcl_hit'.
>
> do something like:
>
> sub vcl_deliver {
>    if (obj.hits > 1) {
>        set resp.http.X-Cache-Hit = "true";
>    } else {
>        set resp.http.X-Cache-Hit = "false";
>    }
> }
>
>
Shouldn't it be obj.hits > 0?

Scott read this about adding the header:
https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader

Greetings.


> Regards,
> --
> Tollef Fog Heen
> Varnish Software
> t: +47 21 98 92 64
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



-- 
Jorge Nerín
<jnerin at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110711/2c348dbd/attachment-0003.html>


More information about the varnish-misc mailing list