Redis is an in-memory data structure store, used as a distributed, in-memory key-value database, cache and message broker, with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indices.
Requirements to Configure Redis on WordPress:
- A server configured with Redis
- Redis path
- Domain with WordPress installed
- WordPress admin login details
- FTP/ Filemanager access to edit files.
Steps to follow:
1. Login to your WordPress account.
2. Move to the Plugins section, select Add new, search for Redis in the search bar, and install Redis Object cache.
3. Now open the wp-config.php file of your website and add the following code.
Note: Change the path of your Redis sock file according to your installation.
// Redis define ('WP_REDIS_CLIENT ', 'phpredis'); define ('WP_REDIS_SCHEME', 'unix'); define ('WP_REDIS_PATH', '/run/redis/redis.sock'); define ('WP_REDIS_PORT', 0); Save the file after adding the code
4. Head back to the wp-admin of your website and activate the Redis plugin.
5. As the plugin is enabled, head to settings of Redis and Enable Object Cache.
6. If the path and installation are successful, you should be able to see the following screen.
Congratulation, Redis is enabled on your WordPress website.