Object caching on Managed WordPress
Object caching is a form of server-side caching that stores database queries to reduce the time it takes a site to deliver data. With object caching, the data is pulled from the cache without having to query the database directly. Object caching can also help reduce the likleyhood of your site exceeding server limitations for PHP execution time.
If you're experiencing odd behavior on your site between page loads, object caching may be affecting how the pages are being generated. In this case, you can try flushing the cache and testing your site again.
How do I flush object cache?
Your Managed WordPress plan automatically controls the maximum time to live (MaxTTL) of your object caching, but there are times when you may need to manually flush it. Once you've flushed the object cache, test your site again.
- Sign in to WordPress.
- At the top of the WordPress dashboard, select Managed WordPress and then Flush Cache.
You should test your site to verify the issue was resolved.
How can I see what is being cached?
If you're troiubleshooting issues on your WordPress site, you can generate a list of queries, in groups, that are being cached.
- Sign in to WordPress.
- On the left-side menu, under Settings, select Object Cache.
- From the top menu, select Tools.
- Under Groups, select Scan groups.
What if I need more details for troubleshooting?
To see more granular details for your object caching, you'll need a plugin that provides the ability to see how database queries affect your site's page loads. There are many third-party plugins available that can get this info, we recommend the Query Monitor plugin or one with equivalent features.
How do I disable object cache?
You can disable the object caching for your WordPress site by adding a line of code to your wp-config.php file.
Note: These steps outline how to do this task through the File Manager in your Managed WordPress plan. If you prefer to access the wp-config.php file with an FTP client, be sure to re-upload the file after making changes.
- Go to your GoDaddy product page.
- On your My Products page, next to Managed WordPress, select Manage All.
- For the website you want to access files for, select Tools from the menu.
- On the right side, next to File Browser, select Open.
- Find the
wp-config.phpfile and select it.
- On the top menu, select View, and then select Edit to open the editor.
- Insert the following line of code to disable your object cache:
define( 'MWP_OBJECT_CACHE_DISABLED', true);Warning: This line of code must be inserted above the line:
/* That's all, stop editing! Happy publishing. */Example:
- Select Save.
You can re-enable object caching by removing the line that was added in the steps above and saving the changes.
- Here's how to clear the CDN and Varnish cache.