WordPress
Guide to setting up Redis Object Cache in WordPress: find your Redis details in the control panel, edit wp-config.php and activate the plugin.
WP-CLI
WP-CLI is available on all our servers, so you can use WP-CLI to set up and manage WordPress.
Redis Object Cache plugin in WordPress
The Redis Object Cache plugin uses Redis for caching, which can provide better performance, especially on larger, heavy websites with a lot of cached data that is accessed on every page load.
Since Redis is not available to all customers and requires individual configuration, you need to set it up manually.
Step-by-step guide to setting up Redis Cache in WordPress
1. Find your Redis details
You can find your Redis details in Our Control Panel in the left-hand menu under Redis.
This is also where you can create a Redis instance, if you have not already done so.
2. Edit wp-config.php
To configure Redis Cache, you need to add the following lines to the top of your wp-config.php file:
define('WP_REDIS_HOST', '<hostnavn>');
define('WP_REDIS_PORT', <port>);
define('WP_REDIS_DATABASE', 0);
define('WP_REDIS_PASSWORD', '<password>');
Replace <port>, <hostnavn> and <password> with the relevant details for your Redis instance.
3. Install and activate the Redis Cache plugin
- Log in to the WordPress admin panel.
- Go to Plugins → Add new.
- Search for Redis Object Cache.
- Click Install now and then Activate.
- After installing the plugin, go to Settings → Redis and click Activate
4. Verify that Redis Cache is working
After installing and activating Redis, you can check whether Redis Cache is working correctly by navigating to Settings → Redis in the WordPress admin panel. It should say that it is connected.
Article from the support category: PHP