No subject

duja at duja at
Tue Apr 8 16:15:33 CEST 2008

Im trying to figure out some ways to extend the response headers with some info of the request. What I want for now is if it was a hit or miss and which backend it used.

I cant figure out how to know which backend it used. The only way i know of is if the backend would deliver a header with host name or something similar. Is there any way to do this in VCL?

I thought I could do like this to see if it was a miss or not but it didnt work. Im not even sure if the Age-header is always 0 on misses or if it could be 0 on hits too?

sub vcl_deliver {
        if(resp.http.Age > 0) {
                set resp.http.X-Cache = "HIT";
        } else {
                set resp.http.X-Cache = "MISS";

/ Erik

More information about the varnish-misc mailing list