Varnish – it doesn’t just go on wood!
Caching is one of the most misunderstood topics in our industry which never fails to surprise me given it’s also one of the most fundamentally important things to consider when building a site with user experience in mind.
Speed is everything when it comes to user experience. No amount of time spent on UX design, content structure or great mobile experience can gloss over slow response time. Put simply, time is money and people are all the more reluctant to wait. The modern user of web services has the expectation that the service they are consuming will work quickly, with little to no inconsistency. Today’s user also has less tolerance for businesses that can’t deliver their desired experience and will quickly go elsewhere if they feel let down.
So what is caching in this context? It’s a technique used to ensure your website remains fast in as many situations as possible. For the purposes of this article we’ll focus on an open source tool called Varnish which has become ubiquitous in this space over the past few years.
Never heard of it? This is how they describe it on their site: ‘Varnish is a web application accelerator. You install it in front of your web application and it will speed it up significantly.’
Naturally there’s a bit more to it than that but from a high level this is all there is to it. You install Varnish on your existing server and everything gets faster, a LOT faster. To put this into perspective, in years gone by when I was just starting out in the hosting industry as a Solution Architect my boss joked ‘Don’t tell people about Varnish, we’ll never sell any servers!’ He wasn’t kidding.
The core reason for this is that Varnish processes all the different types of request that your website may receive ahead of time and stores the results to those requests in a way which allows it serve that content much quicker than your traditional web server stack, with considerably less resource consumed on your hosting environment.
The net result is a faster site creating improved user experience and a cost saving on your hosting bill. This technique is especially pertinent for websites that have big spikes in visitors created by social media activity, e-mail marketing activity or live event interaction. Caching comes into its own in these situations and is the key enabler which underpins every major site on the web today.
The challenge with implementation of this type of technique is ensuring Varnish knows what to cache and what not to cache. Dynamic content such as what’s in a user’s shopping basket needs to be updated in real time, while the rest of the page does not.
The key take away here is you want caching on your website and it’s worth investing to have it in place as it pays back in the long term. To achieve this we recommend you select an agency who is well versed in caching technique to build your site and a hosting company such as Wirehive who will fully support the Varnish caching engine.
Next month… the tech version!