The good folks over at Varnish Software have built the handy Varnish Cache to help folks like us speed up our websites.
Varnish does some really neat stuff. It sits in front of your web server and âremembersâ what that server spits out.
On subsequent requests for the same content, it hands out a cached copy almost instantly rather than making your server do loads of work.
Itâs best explained in this handy 2(:32) minute video from Varnish themselves:
But once youâve got it installed, how do you know itâs working? Well, fortunately Varnish have included some handy headers to help you out:
X-Varnish
tells you Varnish is up and running, and your trafficâs going through it.
However, that doesnât mean itâs working properly. It could be failing to cache your content and requesting it from the server each time.
X-Cache
solves that mystery by telling you if Varnish HIT the cache, or if your request suffered a cache MISS. If you get a MISS value in that header, Varnish is (for some reason) unable or unwilling to cache your content.
To find these headers, youâll have to:
- Open your browserâs developer tools
- Switch to the network view (where you should be able to inspect each network request)
- Inspect the headers of the request you want to check X-Varnish and X-Cache for (probably just the / or index page)âŠ
If that sounds waaay to complicated for you, youâre welcome to use my free site: Is Varnish working
Enjoy! Post here in the comments if you find anything wrong with the site.