Overview

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.

Tip

Ensure you have WT3C installed and configured correctly before proceeding: W3 Total Cache Installation Guide.

Instructions

  1. Login to the Admin dashboard of your WordPress website, then go to Performance -> General Settings:
    Debugging the W3 Total Cache Page Cache
  2. Scroll down to Debug, then enable the extra debug for Page Cache:
    Debugging the W3 Total Cache Page Cache
  3. Click Save all settings to save the changes. This will now start collecting debug information in your wp-content/cache/logs/ directory.
  4. To view these logs, simply login to Plesk, then select logs:
    Debugging the W3 Total Cache Page Cache
  5. On the right hand side, select Add custom log:
    Debugging the W3 Total Cache Page Cache
  6. Navigate to the correct path (httpdocs/wp-content/cache/logs) and select the latest page cache log:
    Debugging the W3 Total Cache Page Cache
  7. 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:
    Debugging the W3 Total Cache Page Cache
  8. 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:
    Debugging the W3 Total Cache Page Cache
  9. 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.
  10. 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.
  11. Once you’ve corrected the additional pages, ensure you disable the debugging by going back to Performance -> General Settings and deselecting the Page Cache:
    Debugging the W3 Total Cache Page Cache
  12. Click Save all settings to finalise the changes.

Note

As the debug logs do come with a performance reduction, don’t forget to turn them off after you’ve finished identifying the issues.

Was this article helpful?

Related Articles