Quickstart
To get Object Cache Pro up and running quickly, follow the guide below. For a more in-depth guide, head over to Installation.
Requirements
Object Cache Pro requires PHP 7.2+ and the PhpRedis (4.0+) or Relay extension.
Preparation
Before getting started, be sure to uninstall all existing object cache plugins, such as Redis Object Cache and WP Redis.
Additionally, if a /wp-content/object-cache.php drop-in exists, delete it.
Installation
Object Cache Pro can be installed using Composer, or uploaded as a plugin in your Dashboard. For larger deployments, you can deploy it as a Must-Use plugin.
Configuration
You can activate the plugin right away, but Object Cache Pro must be configured before the object cache can be enabled. This is done using the WP_REDIS_CONFIG constant in your wp-config.php file.
This configuration is a great starting point:
define('WP_REDIS_CONFIG', [
'token' => '<your-license-token>',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0, // change for each site
'split_alloptions' => true,
'debug' => false,
]);
define('WP_REDIS_DISABLED', false);
For advanced features such as compression and asynchronous flushing, check out the complete list of configuration options.
To connect to Redis clusters or use replication, see the connection guide.
Activation
The object cache can be enabled in the dashboard widget by clicking Enable Cache, or by executing the wp redis enable CLI command.
Enabling the object cache automatically flushes the configured Redis database and deletes transients from the WordPress database to avoid stale cache data, so there’s no need to flush it by hand.
You’ll now see “Status: Connected” in the dashboard widget. If not, head to Tools > Site Health for more information.
That’s it! 🚀🎉
Deployment
If your site has an automated/scripted deployment process, follow the deployment guide to keep your object-cache.php drop-in up-to-date.