Redis is an extremely fast in-memory (RAM-based) data store for a variety of data structures. Due to it's speed, it is most often used for caching, session storage, task queues, and other purposes. In this tutorial you will learn how to install and configure Redis for a WordPress website so you can speed up the site and reduce load on the primary database.
Redis database is included with our E-COMMERCE and PLUS shared hosting plans.
Open the DirectAdmin control panel by clicking a button in the service management panel.
In DirectAdmin go to Advanced Features > Redis page, and click on the "Enable" button to activate Redis.
Copy the value shown under Redis socket file and save it somewhere safe - you will need this path later.
After these steps Redis is active and ready for use.
For WordPress to detect the Redis instance you just enabled, add two extra lines to wp-config.php.
1. In DirectAdmin open System Info & Files > File Manager.
Browse to the directory where WordPress is installed (the path may differ if WordPress is in a sub-folder):
yourdomain.rfox.site/public_html/yourdomain.rfox.site - is a directory matching your website's domain name. In this example the domain used is: features.rfox.site.
In the file catalog open wp-config.php:
2. Just above the final line in wp-config.php file, add the two Redis settings and replace the socket path with the one you saved in step 1:
define( 'WP_REDIS_SCHEME', 'unix' ); define( 'WP_REDIS_PATH', '/home/rfcfeature/.redis/redis.sock' ); // Replace with your own socket path
In the WordPress admin area open "Plugins" and click "Add New Plugin" button.
Search for "Redis Object Cache" and install the plugin once it appears.
After installing the plugin, activate it by clicking the "Activate" button. A new Redis configuration page will appear.
In the Redis Object Cache page you should see green tick boxes with "Filesystem: Writable" and "Redis: Reachable". Finally, click on the "Enable Object Cache" button to activate Redis plugin.
After enabling the object cache setting, you should see the following information:
If everything was completed correctly, Redis is now caching WordPress objects in real time - one of the most effective ways to improve your site's speed and visitor experience.
Enabling Redis object cache for a website is straightforward: enable a setting in DirectAdmin control panel, include additional parameters in the WordPress configuration and install a plugin. If you are still experiencing issues or unsure about any step, don’t hesitate to reach out for help. You can contact Redfox Cloud support via live chat on our website or by emailing [email protected]
HTTPS protocol - currently seems mandatory for everyone on the web. Getting an SSL certificate is now easier than ever. Let’s encrypt allows you to...
How to create a MySQL Database using the DirectAdmin control panel Whether you are a beginner website creator or a game server administrator, knowing how to...