On Mon, May 2, 2016 at 7:00 AM, Debraj Manna <[email protected]> wrote:
> Thanks Thomas.
>
> How can I maintain a counter per url. In vcl_deliver obj.hits will again
> give me the overall hits.
As I said, you have to implement this yourself using VCL and varnishncsa.
Example of VCL:
# 38. match rule for PDF pages
if (req.url ~ "^\/pdf\/([^\/]+)\-(\d+)\.html$")
{
set req.http.X-MatchRule = "38";
return (hash);
}
[...]
std.log("MR:" + req.http.X-MatchRule);
Then, call varnishncsa with -F and %{VCL_Log:MR} plus
%{Varnish:handling} to log the match rule and the handling of the
request (miss, hit, pipe, pass, whatever). You will have to parse this
output yourself to compute a ratio.
--
Thomas Lecomte / Virtual Expo
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc