Rate this article :
5/5 | 1 opinion
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
Sommaire
Procédure
Redis is a very high-performance key-value storage service. Quite similar to Memcached, Redis has the advantage of being persistent: the data is not volatile.
Given the fairly simplistic nature of its data structure, and the fact that all the data is preloaded into memory when Redis starts up, searching and retrieving information from a Redis database using its unique key is much faster and less resource-intensive than retrieving the same information from a traditional database such as PostgreSQL or MySQL.
You can find out more about Redis on their official website.
The Redis object caching system is not to be confused with page caching systems such as Fastest Cache, LiteSpeed or WP-Rocket. Page caching systems cache an entire page that has already been built, whereas an object caching system allows you to cache certain elements of the site, such as an article, a comment, a product, etc.
An object cache system simply makes less of a demand on the MySQL database when building a page, while reducing response time, whereas a page cache system keeps a page completely built for later use. As a result, a Redis object cache system will not be beneficial for predominantly static sites such as blogs and storefront sites.
Only websites that are highly dynamic (their page content cannot be cached for long enough) are good candidates for object caching. This is particularly the case for certain ecommerce sites, sites with members' areas, discussion forums and certain blogs where the comment section is particularly active.
If your website has static content, you will be better off optimising page caching with Fastest Cache or LiteSpeed.
The Redis service is available for all cPanel accounts on the default port (TCP 6379). For a PHP script to be able to communicate with a Redis server, it will need to be supplied with a suitable library. The most popular libraries include :
Depending on the PHP script you're using, you'll be able to use one, the other or both. The WordPress plugin we're going to recommend is compatible with both libraries.
To activate PhpRedis, which is the PHP Redis extension, log in to your cPanel interface and click on"Select a PHP version" in the"Software" section.
Tick the"Redis" extension to activate it.
To use Redis as an object cache on WordPress, you will need to install the Redis Object Cache plugin. From your WordPress dashboard, go to"Extensions" then"Add".
Search for the"Redis Object Cache" plugin and click on"Install now".
Once the installation is complete, activate the plugin by clicking on the"Activate" button.
From your cPanel file manager, edit your wp-config.php file and add the following lines:
define( 'WP_REDIS_CLIENT', 'phpredis' ); define( 'WP_REDIS_SELECTIVE_FLUSH', true); define( 'WP_REDIS_PREFIX', 'monsite.com' );
Once you've added these settings and saved the file, return to your WordPress dashboard. In Settings then Redis, activate the Redis object cache system:
Cache calibration options can be added to wp-config.php for more specific needs. For more information, please consult the plugin's official documentation.
You can also use the WordPress plugin W3 Total Cache to cache the results of database queries. Note that this method is different from object caching. It is only recommended if a heavily used plugin does not use the WordPress object system (such as custom post types) to store and retrieve data.
1. Log into your WordPress Dashboard and go to"Extensions/Add".
2. Search for the"W3 Total Cache" plugin and click on"Install now".
3. Activate the plugin by clicking on the button.
4. Click on"Settings" below the plugin to access its configuration.
5. Go to the"Database caching" section, tick the"Database checkbox" box and choose"Redis" from the drop-down window. Finally, click on"Save settings and purge cache" to save your request.
You are now able toactivate and configure the Redis Object Cache plugin on your Wordpress site with your cPanel web hosting. Note that all Redis data is accessible to all users of the same cPanel server. As a result, it is imperative never to store sensitive information on Redis.
Don't hesitate to share your comments and questions.
Rate this article :
5/5 | 1 opinion
This article was useful to you ?
Yes
No
1mn reading
How do I configure Cloudflare on a website hosted on cPanel?
3mn reading
How do you use Memcached on your cPanel website?
4mn reading
Speed up your site with Fastest Cache - Cache Varnish
3mn reading
How can I use IpXchange to customise the IP of your domain?
Bonjour,
Merci de votre retour,
Le message "Connection refused" indique que l'extension Redis ne parvient pas à se connecter au serveur Redis.
Le problème rencontré peut-être dû à plusieurs facteurs, que nous ne pouvons pas déterminer via cette plateforme de Question.
Nous vous invitons donc à passer par notre système de support technique disponible depuis votre espace client, afin de vous apporter l'aide adéquate. (https://aide.lws.fr/a/268)
Cordialement, L'équipe LWS.
Bonjour,
Merci de votre retour.
Grâce aux informations renseignées à l'ouverture de votre question, j'ai pu constater que vous ne possédez de formule cPanel.
Une formule cPanel est nécessaire pour bénéficier des fonctionnalités que vous souhaitez.
En savoir plus sur les formules cPanel disponible chez LWS : https://www.lws.fr/hebergement-cpanel.php
Je vous remercie de votre attention et reste à votre disposition pour toute autre question ou complément d'information.
Nous vous invitons à contacter notre service support à travers votre espace client, afin de vous apporter une aide si vous rencontrez des difficultés quelconque. (https://aide.lws.fr/a/268)
Cordialement, L'équipe LWS