The following article appeared originally on the JAX Magazine website in the lead-up to the JAX Finance event in London, April 27-29, 2016, republished here courtesy of JAX Magazine.
Update January 13th, 2017: You can find an updated version of this article supporting Wordpress 4.4 and Varnish 4.1 in the Varnish Software Web Developer Wiki: Step-by-step guide to making your WordPress site fly. The wiki contains VCL snippet examples, tips and tricks for web developers and guides for other CMS systems as well.
This article was originally written by Web Designer Magazine - http://www.webdesignermag.co.uk/
Increase the performance of Wordpress using Varnish, and optimise your content-heavy sites
Nobody like to wait ages for a page to load. If your site is slow, people will go somewhere else before they can read that great article you wrote. Page speed is still an issue for many sites and recent studies show that 40 percent of users will abandon your site if it takes more than three seconds to load. this is where Varnish comes in.
Varnish is an HTTP accelerator or caching HTTP HTTP reverse proxy. It receives requests from clients and tries to answer them from the cache. If it cannot answer from the cache it will forward it to the origin server, fetch the response, store it in cache and deliver it to the client. When Varnish has a cached response ready, it is typically delivered in a matter of microseconds: two orders of magnitude faster than the average origin server, so make sure that Varnish answers as much as possible from the cache.
In this tutorial, we will go through some of the common steps required to install and configure Varnish and integrate it wil WordPress to take your site to the next level. Let’s get started.
1. Install Varnish
Varnish packages are redily available for many Linux distributions including Red Hat, Centos, Debian and Ubuntu. In this tutorial we will assume Ubuntu 14-04.1 LTS as the underlying operative system and we’ll be installing the latest version of Varnish. For other operating systems check the latest releases on varnish-cache.org/releases. Open a command prompt and type the following as root.
apt-get install apt-transport-https