News for hackers. Stuff that matters.
Re:Varnish: Counting hits on cached objects by aenum on Monday April 06, 2015 @08:53AM (#9327801)
Indeed. You would have to poll the endpoints you want to monitor periodically and obviously the hit counter will reset when the object is expired/purged.

Something like

  sub vcl_deliver {
    if (client.ip == "127.0.0.1") { # or header/method/whatever
      set resp.http.X-Cache-Hits = resp.hits;
    }
  }
Re:Varnish: Counting hits on cached objects by _cyqui on Monday April 06, 2015 @10:46AM (#9328304)
Will quote this thread in the blog post so that it's more complete by also mentionning this solution (could fit some needs)