To enable Redis, you’ll have to have Redis installed on your site. You can request this from Servebolt support. There are multiple plugins available to enable Redis for WordPress. This example uses the plugin Redis Cache which has 60K installs and is actively maintained.
Time needed: 5 minutes.
After you have received confirmation from support that Redis is enabled for your site, you can enable it by following this recipe.
- Add the configuration to wp-config.php
Add configuration using wp-cli from the command line:
$ wp config set WP_REDIS_PATH --raw "__DIR__ . '/../redis.sock'"
$ wp config set WP_REDIS_SCHEME "unix"
alternatively, you can do this by editing wp-config.php and adding the following defines:
define('WP_REDIS_PATH', __DIR__ . '/../redis.sock');
Please not that if you are running WordPress out of some other directory or subfolder, you’ll have make the path to the socket relative to your applications directory.
- Install the Redis Cache plugin
$ wp plugin install redis-cache --activate
- Verify that it is working
You can start the Redis monitor from the command line by running the following command
$ redis-cli -s ~/redis.sock monitor
After this, click around on your site a few times. You’ll see an OK first and then massive amounts of text scrolling by. This is the data stored and pulled from the Redis cache.
Give us your feedback on this article
Did this help you?
Want to speed up your site, easily?
Set up your site on Servebolt, free of charge for 60 days, and see for yourself how fast it can be on our extremely fast hosting.
A faster site converts better, ranks better on Google, and is better for the climate.