inspect the response header to find cached request

Stewart Robinson stewsnooze at gmail.com
Tue Feb 22 11:18:17 CET 2011


Hi,

You could change your vcl_deliver function in your vcl to have
something like this.

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


This works on the 2.0x series. Can't remember off the top of my head
whether vcl_deliver has renamed obj to something else.

Stewart Robinson
@stewsnooze

http://fullfatthings.com/


On 22 February 2011 10:10, Junxian Yan <junxian.yan at gmail.com> wrote:
> Is there any parameters to determine if some request has been cached by
> varnish when inspect the response header
> Junxian
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



More information about the varnish-misc mailing list