How to Speed Up WordPress with Redis Caching

How to Speed Up WordPress with Redis Caching in few easy steps. Redis is an in-memory database which can be used as a data store or cache. Redis is an ideal solution to speed up WordPress and any other software that supports Redis caching. In this tutorial we are going to show you how to setup WordPress caching with Redis on a Linux based VPS.

1. Install Redis on a Linux VPS

We assume that WordPress is already installed on your system so we will skip the WordPress installation step. If you don’t have WordPress installed, you can follow our tutorial about how to install WordPress on a Linux VPS, or if you are using one of our WordPress hosting plans you can contact our admins to install WordPress for you.

The installation of Redis is straightforward. If you are using Ubuntu VPS run the following command to install Redis:

If you are using CentOS VPS you can use the following command to install Redis:

yum install redis

Make sure that you have EPEL (Extra Packages for Enterprise Linux) repo enabled on your server.

Start and enable Redis on system boot:

systemctl start redis.service
systemctl enable redis.service

2. Install Redis PHP extension on a Linux VPS

In order to be able to use Redis as object cache for your WordPress website you need to install the Redis PHP extension. It will allow WordPress to communicate with the Redis key-value store.

On Ubuntu run the following command:

apt-get install php-redis

3. On CentOS run the following command:

yum install php-pecl-redis

4. Install Redis Caching Plugin in WordPress

Log in to your WordPress dashboard and navigate to Plugins > Add new. Search for Redis and install the Redis Object Cache plugin from the list. Once the installation is completed, navigate to Plugins again and enable the Redis Object Cache plugin.

Next, navigate to Settins > Redis and click on Enable Object Cache to enable the object caching in WordPress. The default configuration should work out of the box sonce the default Redis listening address is 127.0.0.1 and the default listening port is 6379.

5. Verify Redis caching on WordPress

By using the Redis monitor you will be able to see all the requests processed by the Redis server and it will help you to understand what is happening to the database. The output should be similar to the one below:

Enabling WordPress caching with Redis is an easy task if you have a WordPress Hosting with us. Feel free to ask our expert Linux Administrators to speed up your WordPress with Redis caching on your server for you, and it will be taken care of immediately. They are available 24×7, so you can get the help you need at any time.

PS. Feel free to share this blog post on How to Speed Up WordPress with Redis Caching, by using the social network shortcuts – you can also leave a comment instead, found under the share buttons.