Turbo Charge your WordPress Install

At DOWO Digital we include LiteSpeed & Redis Caching FREE to all users, allowing you to turbo charge your website, delivering insane performance, and sub second page loads! This guide will take you through the 5 steps required to enable these awesome features, and installing them into your WordPress install.

What is caching, and why use it?

To understand what page caching is, lets look at a standard WordPress install: when its first installed, it will run pretty fast. However, nobody uses a vanilla WordPress – usually you will build a custom theme, and you’ll also add a number of plugins. Your site now looks great, and thanks to the various plugins, it has all the functionality you need. However, as a result of all these extras, the site will inevitably load a little slower.

It happens in part because every time a page loads, all of the PHP code in your theme and active plugins has to run, in order to create the final output of the page. If you have lots of plugins, or a theme or plugin that’s poorly coded, this can cause a significant overhead and result in a really slow site.

The idea of caching is that rather than do all of that heavy lifting each and every time a page loads and for each and every visitor, we only do it once when the page is accessed for the first time. We then store the output of the code, and the next time someone visits the page rather than rebuild the entire page dynamically, we just output the that stored page instead.

LiteSpeed handles this caching, and makes sure that your visitors are seeing the latest version of the page by purging old entries, and pre-caching new pages when changes are made too.

In addition to loading your pages, and executing the PHP, your WordPress install is backed by a Database, so we can add another layer of caching there too.

Redis (REmote DIctionary Server) is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.

In its simplest form, Redis is a caching system that can be combined with MariaDB (the database) to optimise the application level speed.

Combined these can lead to sub second page loads, meaning a lightning fast experience for your end users. Here’s how you do it:

Step 1 – Enable Redis in PHP via cPanel

  1. Log into your cPanel
  2. Search for Select PHP (under Software)
  3. Ensure that Redis is enabled

Step 2 – Enable Redis in cPanel

Now that Redis is available in PHP, we need to enable this in cPanel too, and get your socket address.

  1. Log into your cPanel
  2. Search for Redis (under Software)
  3. If Disabled, then set Memory Limit to 96MB, and click Enable
  4. Once enabled, you will see a screen similar to the below:
  5. Copy your socket address, as we’ll need this later. Generally it will be /home/USERNAME/.kxcache/redis.sock

Step 3 – Enable LiteSpeed Cache in cPanel

Finally, we need to enable LiteSpeed for use by WordPress

  1. Log into your cPanel
  2. Search for LiteSpeed (under Software)
  3. If Disabled, then click Enable

Step 4 – Install LiteSpeed WordPress Plugin

Now that we’ve enabled the tools in cPanel, we need to install the LiteSpeed Plugin in WordPress.

  1. Log into your WordPress Dashboard, and go to Plugins – Add
  2. Search for LiteSpeed Cache and Install
  3. Activate LiteSpeed Cache

Step 5 – Configure LiteSpeed Plugin

Now that LiteSpeed is installed, we need to configure it. We’ll go through a simple configuration here, enabling Caching, both at a Page & Object level, which will speed up your site significantly.

  1. Open LiteSpeed Cache Page
  2. Enable the Cache. The most important one to enable is the 1st Enable Cache option.
  3. Go to the Object Cache Tab, and set the following options.
    1. Turn on Object Cache
    2. Set Method to Redis
    3. In Host enter your Redis Socket from Step 3
    4. Set Port to 0
    5. Click Save

Thats it – you’re done! There are lots of optimisations avaialble in LiteSpeed, and we’ll be doing some more articles on them in the future – keep checking back for more information!

Need Support?

If you’re having any issues with setting up caching, or want the team here at DOWO to set this up for you, then simply get in touch, and we’ll have a chat with you.