Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to list the contents of the varnish cache storage? Also, it would be nice to somehow list the most frequent cache hits.

I found a way to see the most frequent cache misses by listing what is being sent to the backend with:

varnishtop -b -i TxURL

It would be very useful to see what are my top cache hits URLs.

share|improve this question
up vote 1 down vote accepted

This answer was originally posted on stackoverflow, and I think it is quite helpful:

You can use the parameter "Varnish:hitmiss" of varnishncsa.

First capture a sample of logs with:

varnishncsa -F '%U%q %{Varnish:hitmiss}x' -n NAME -w /path/requests.logs

and then:

sort -k 1 /path/requests.logs | uniq -c | sort -k 1 -n -r | head -25

share|improve this answer
Soemthing is wrong with this answer. THis command gives me varnishncsa: invalid option -- 'F' – Zyava Mar 18 '13 at 17:47

There's no way of listing the contents of the cache.

You can get the list of top requested URLs with

varnishtop -i RxURL

but there's no easy way to tell from that which are cache HITs and MISSes. There is a script here which may help you.

share|improve this answer
actually posted the same question on stackoverflow, got some info from there:… – Martin Taleski Jan 17 '13 at 23:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.