0

I want to check whether a page view on localhost encountered a cache hit or a cache miss. I'm running varnish on my local machine. Next, I wanna check the X-cache header in response. But I cant see any X-cache tag in the response header. i'm able to see server, Etag, x-runtime et. , but not X-cache

How can I see the X-cache?

nish
  • 6,952
  • 18
  • 74
  • 128

1 Answers1

0

By adding it;

sub vcl_deliver {
    if (obj.hits > 0) {
            set resp.http.X-Cache = "HIT";
    } else {
            set resp.http.X-Cache = "MISS";
    }
}
Clarence
  • 2,944
  • 18
  • 16
  • Then it seems it doesn't arrive at vcl_deliver, which as far as I know only can mean that you deliver with pipe – Clarence Sep 06 '13 at 07:20