varnishd -C

Baptiste Assmann bedis9 at gmail.com
Mon Nov 16 07:13:25 CET 2009




To log to syslog, you must use inline C.
To see request from Varnish to the origin, use varnishlog -b RxURL
You can use VCL to add a X-Cache header:
# Called before a cached object is delivered to the client
sub vcl_deliver {
        if (obj.hits > 0) {
                set resp.http.X-Cache = "HIT";
        } else {
                set resp.http.X-Cache = "MISS";
        }
        remove resp.http.Via;
        deliver;
}

good luck


Le 16 nov. 2009 à 03:41, I I <ibeginhere at gmail.com> a écrit :

> so I can't "To log to syslog "? I find the varnish maybe miss to  
> process some url.I want to more detail about the varnish process by  
> the log.
> In my varnish and backend server ,some request back from the backend  
> server to client , from the HTTP response Head, there are no sign  
> marked by the varnish .there should be some options marked by the  
> varnish ,like X-Cache :"HIT" or "MISS".
> even though in the varnishlog output , there are nothing about there  
> urls.
>
> 2009/11/12 Ken Brownfield <kb+varnish at slide.com>
> varnishd -f /path/to/your/config.vcl -C
>
> This will compile your VCL into C and emit it to stdout.  It will  
> show prototypes for all of the VRT interface accessible from VCL,  
> the structs representing your backend(s) and director(s), and the  
> config itself.  The wiki is a little misleading (and -C isn't  
> otherwise documented AFAIK): it's not a document per se, but it's  
> extremely useful when writing inline C -- hunting down VRT  
> definitions in the code is no fun.
> -- 
> Ken
>
> On Nov 11, 2009, at 7:19 PM, I I wrote:
>
>> In the web of official varnish ,http://varnish.projects.linpro.no/wiki/VCLExampleSyslog
>> there is some C variable names used in VCL.but when I type the  
>> command "varnishd -C",nothing return .and when I enter the website  
>> command to the VCL,error return like this
>> "Running C-compiler failed, exit 1
>> VCL compilation failed"
>> what I neet to prepare for  this  ?
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20091116/22e4b7bf/attachment-0001.html>


More information about the varnish-misc mailing list