Object caching is a great way to boost the performance of WordPress sites. Thanks to a direct partnership with Object Cache Pro, Redis caching is available and easy to configure for all Pagely VPS customers. In this article, we’ll show you how to activate and use Redis caching on your Pagely VPS.
(Note: As with any change to your site, we strongly recommend that you test Redis caching on a staging site before making any changes to your live site. For more information, see our documentation on creating staging environments.)
Setting Up Object Cache Pro
- Start by logging into your Pagely VPS over SSH.
- Next, navigate to the root directory of your Pagely site.
cd ~/sites/example.com
- Before making any changes, you’ll first want to check for any object caching that may already exist. To check the status, use the following command:
The output of this command will show the status of any object caching that currently exists on your site:pagely-redis status
dom mu_plugin object_cache notes gitdeploy.pagelyexample.com 0 0 Status codes: -1 Something exists but not the recommended Redis Cache Pro setup 0 Not present 1 Installed
- If your output looks like the above (nothing exists and notes are empty), you’re ready to continue with the installation in the next step.
- If you see hosting_config_reset_needed inside the notes field, your wp-config-hosting.php file will need to be reset. Please contact the Pagely support team for additional assistance.
- If the mu_plugin or object_cache fields report a -1 status code, this means that you have an existing cache configuration already in place that doesn’t match our recommended Object Cache Pro setup. To use our recommended configuration, you’ll need to remove any existing solutions before you can continue.
- If the mu_plugin and object_cache fields show as installed, you don’t need to do anything further. You’re already using our recommended configuration.
- Now that the status has been checked, you’re ready to continue with the installation.
To install the Object Cache Pro plugin as well as any additional configuration, use the following command:pagely-redis install
Checking Your Site
Once the installation is complete, your WordPress site will be configured to use Redis object caching. Here’s a few things to check after Redis caching has been enabled:
- If Redis caching is properly installed on your WordPress site, running the following command from inside your site’s root directory will provide additional information:
wp redis info
- Be sure to check over your site after activating Redis caching. While it’s unlikely that you’ll run into any issues, it’s always important to perform a visual inspection of your site when making any configuration changes like this.
- Check that your cache is properly being flushed when necessary. This can be done by either flushing your cache from within your WordPress admin or flushing your site’s cache with WP-CLI.
Uninstalling Object Cache Pro
If you'd like to uninstall Object Cache Pro, the following command can be used:
pagely-redis uninstall
As always, if you run into any further questions that we haven’t already answered, feel free to reach out to the Pagely support team.