Redis is an in-memory data storage which supports different data structures like lists, strings, and associative arrays. It can improve the performance of websites that use databases by caching the queried data directly in the server memory using the key-value model. Since it offers faster access times for frequently accessed data, Redis can significantly reduce the load time of your scripts or website. More information about Redis is available in its official documentation.
Important: If you do not have a WebApps section in the Control Panel of your account, then this tutorial is not suitable for your particular hosting environment. You can get in touch with us if you need further assistance.
This tutorial will show you how to install and use Redis from within a web application in a few simple steps:
After you install Redis, you will be able to access it via the /home/example/private/redis/redis.sock socket on your website or scripts. You should replace example with the username of your hosting account.
Redis is available by default for some hosting plans. You can check if it is available for your account by running the following command via SSH:
redis-cli ping && echo "Redis is available!"
If Redis is available by default for your account, a message "Redis is available!" will be displayed, which means that Redis works at localhost (with IP address 127.0.0.1) on the default Redis port (6379).
You can install Redis on your account in a web application by following these steps:
You can test if Redis was activated correctly and is working with the following command:
redis-cli -s "$redis_dir/redis.sock" ping
The output of the command should be "PONG", which indicates that Redis is working correctly.
You can install Redis in a web application using the hosting Control Panel > WebApps section by following these steps:
After installing Redis in a web application, you need to enable support for Redis in the PHP configuration for your website. You can do this via the PHP settings section of your hosting Control Panel. Once there, open the PHP settings management page for your website by pressing the Manage button next to its subdomain, and select the "redis" extension. Press the Save button to save the PHP configuration.
The final step to use Redis on your website is to configure your scripts or software applications to connect to the Redis socket of your web application. If your username is example and you installed Redis in the /private/redis/ directory of your account, the Redis socket would be:
/home/example/private/redis/redis.sock
Details on how to enable Redis support for a particular script or a software application should be available in its official documentation. Otherwise, you should contact the developers and/or vendors of the script or software application that you use for assistance.
To use Redis on WordPress, you need to install a plugin that offers support for it. One such plugin is LiteSpeed Cache. After the plugin is installed on your WordPress website, you need to:
After the settings are saved, the information under Status should indicate that the Redis extension is enabled and the connection test passed.
Another plugin that you can use is Redis Object Cache. To configure the plugin, you need to add the following lines to the wp-config.php file of your WordPress installation in order to set the Redis socket path of your web application (e.g. /home/example/private/redis/redis.sock):
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/home/example/private/redis/redis.sock' );
After you save the changes in the WordPress configuration file, you should be able to enable the Redis caching in the plugin page within the WordPress Dashboard:
To enable support for Redis caching on Joomla version 5, follow these simple steps:
All prices are in USD. No setup fees. Minimum contract period for shared hosting services - 12 months. Full prepayment for the contract period. 100-day money-back guarantee. No automatic renewal. Fees for domain registrations and SSL certificates cannot be refunded in case of an early contract termination.
ICDSoft 2001-2024 © All rights reserved
Terms of Use
|
Legal notice
|
Privacy
|
Reseller terms