Redis Cache for WordPress

How Can We Help?

Redis Cache for WordPress

You are here:
< Back to the Wiki

Do you want to speed up your WordPress server using caching? This article will explain how to do that using Redis.

Prerequisites

It is assumed that you already have a Redis server setup.

WordPress Configuration

To connect your Redis server to WordPress open the wp-config.php and add the following:

define('WP_REDIS_HOST', '127.0.0.1'); // Replace with your address
define('WP_REDIS_PASSWORD', 'FOO'); // Replace with your password
define('WP_REDIS_PORT', 6379); // Replace with your port
define('WP_REDIS_DATABASE', 0); // Replace with your desired database index
define('WP_CACHE', true);

Once Redis is connected, you must install a plugin supporting Redis Caching.
In this article, we continue with Redis Object Cache (wordpress.org).
Once installed make sure to activate it, optionally, you can also enable automagic updates.
Navigate to SettingsRedis, validate that the Filesystem and Redis are green. Click Enable Object Cache and you are all set.

Sources

One Response

  1. MPHSlaats says:

    Could you also check other Redis cache plugins like: W3 Total Cache or LiteSpeed Cache?

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents