W3 Total Cache (W3TC) is a WordPress caching plugin which features advanced caching tools including high speed page caching. While for most websites it works out of the box, some pages may not be cached and this will lead to increased resource usage for your server.
Thankfully W3TC has some detailed debugging built in and this can help identify why some pages aren’t cached.
- Login to the Admin dashboard of your WordPress website, then go to Performance -> General Settings:
- Scroll down to Debug, then enable the extra debug for Page Cache:
- Click Save all settings to save the changes. This will now start collecting debug information in your wp-content/cache/logs/ directory.
- To view these logs, simply login to Plesk, then select logs:
- On the right hand side, select Add custom log:
- Navigate to the correct path (httpdocs/wp-content/cache/logs) and select the latest page cache log:
- This will now display the logs inline with your existing access and error logs. If it’s a development site or low traffic, you can enable real-time updates or alternatively, refresh periodically to see the updated logs:
- Look for the extra debug entries to then determine the page cache result. For example, here’s a page which didn’t cache because it contained additional GET variables:
- If this page is meant to be cached (ie, it’s not unique to the user nor part of a shopping cart), ensure the URI pattern is added to the W3 Total Cache configuration using this guide: W3TC Allow Google and Facebook Click ID tags to be cached.
- Where other reasons for the page not be be cached, evaluate the reasoning to determine if it’s valid (eg POST requests can’t be cached) or if there’s a plugin or theme setting which is enforcing a block.
- Once you’ve corrected the additional pages, ensure you disable the debugging by going back to Performance -> General Settings and deselecting the Page Cache:
- Click Save all settings to finalise the changes.