VCL 4.0 vcl_miss issue

Suyog Shirgaonkar suyogs at rediff-inc.com
Thu Aug 7 06:53:06 CEST 2014


Hi,I am  using varnish cache server 4.0.1. I have infrastructure like frontend as varnish server and between varnish and web server there is one more varnish server placed as midgrace. I want to unset the X-Varnish  cache parameter from backend response  ie. midgrace.I have tried to achieve the same with below code in VCL file, but it not working:sub vcl_deliver {#Called before a cached object is delivered to the client.        unset resp.http.Via;        unset resp.http.Age;        unset resp.http.X-Varnish;        unset resp.http.X-Pad;        unset resp.http.X-Powered-By;        unset resp.http.Etag ;        unset resp.http.Retry-After;        unset resp.http.X-Origin-Img-Unavailable;        if( resp.http.cache-control ~ "max-age=0") {                set resp.http.Expires = "Thu, 01 Jan 1970 00:00:00 GMT";        }        unset resp.http.Server;        set resp.http.Server = "XXXX/4.0.1" ;        #set resp. =  std.log("Obj.ttl : " + obj.ttl);        #if (obj.hits > 0) {        #               set resp.http.X-Cache = "TCP_HIT";        #} else {        #               set resp.http.X-Cache = "TCP_MISS";        #}        if (resp.http.X-Varnish ~ " ") {                set resp.http.x-cache = "TCP_HIT";        } else {                set resp.http.x-cache = "TCP_MISS";        }        return (deliver);} 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20140807/cd58a285/attachment-0001.html>


More information about the varnish-misc mailing list