Support Home > WP Super Cache > Enable WP Cache debugging

Enable WP Cache debugging

Troubleshoot caching issues effectively by enabling the debug mode in WP Super Cache.

Enabling debug mode in WP Super Cache helps you identify and resolve caching issues more efficiently.

Activate the debug mode

You can activate the debug mode by following these steps:

  1. Navigate to your WP Admin dashboard.
  2. Select Settings → WP Super Cache.
  3. Click the Debug tab.
  4. Click the Enable Logging button.

Login to the debugging dashboard

By logging into the debugging dashboard, the system will log to a file in your cache directory. To log in follow the steps:

  1. Find the link that reads, “Login to the debugger, by clicking this link” in the WP Super Cache Settings section.
  2. Click it to be directed to the debugger’s login page, which will appear in a different browser tab.
  3. The username/password combination you will use to log in is displayed below the link you clicked on. It’s a string of characters that looks something like: d2f4429a08d7e24a25e295d410956abc (These are not the actual credentials; replace them with the one shown on your screen).
  4. Enter these credentials into the corresponding fields on the login page.

After you log in, you should see a screen that shows a log output with their timestamps.

Please note:

  • Don’t forget to deactivate the logging mode as soon as you don’t need it anymore. Logging uses server resources, which may cause issues on some servers. The logs, while password protected, still contain potentially sensitive data.
  • Do not copy and paste this log file to a public website! It contains potentially sensitive information about your web server.

Reading the Debug Log

The log file records the decisions made for each request while debug mode is active. The following examples illustrate some of the insights you can gain by reviewing the Debug Log.

Verifying if WP Super Cache is working correctly

The following code – which is similar to any code you can find in a log you generate – tells that visiting the page testington resulted in WP Super Cache serving the request:

12:46:39 90601 /2022/10/21/testington/ wp_cache_get_cookies_values: return:
12:46:39 90601 /2022/10/21/testington/ supercache dir: ABSPATH/wp-content/cache/supercache/supercache.test/2022/10/21/testington/
12:46:39 90601 /2022/10/21/testington/ wp_cache_get_cookies_values: return:
12:46:39 90601 /2022/10/21/testington/ Fetched static page data from supercache file using PHP. File: ABSPATH/wp-content/cache/supercache/supercache.test/2022/10/21/testington/index.html

2022/10/21/testington/index.html was served when the /2022/10/21/testington/ page was requested.

The index.html file is a static file, which isn’t the PHP file that WordPress usually shows. Showing the static file will be faster, which is the desired behavior.

Confirming that preloading is working

Debug Log example:

wp_cron_preload_cache: got 100 posts from position 0.
supercache dir: /home/test-user/example.com/subdir/wp-content/cache/supercache/example.com/subdir/sample-page/
wp_cron_preload_cache: fetched https://example.com/subdir/sample-page/
supercache dir: /home/test-user/example.com/subdir/wp-content/cache/supercache/example.com/subdir/2023/03/06/hello-world/
wp_cron_preload_cache: fetched https://example.com/subdir/2023/03/06/hello-world/
wpsc_delete_files: deleting /home/test-user/example.com/subdir/wp-content/cache/supercache/example.com/subdir/
wpsc_get_realpath: directory does not exist - /home/test-user/example.com/subdir/wp-content/cache/blogs/
wpsc_delete_files: reading files: ..
wpsc_delete_files: reading files: sample-page
wpsc_delete_files: reading files: 2023
wpsc_delete_files: reading files: .
wpsc_delete_files: remove directory /home/test-user/example.com/subdir/wp-content/cache/supercache/example.com/subdir/

This log was generated by setting the preload time to 0 to turn off automatic refreshing, and then click the “Preload Now” button. After a few minutes, the log generated the code shared above.

To verify that preloading is working, you will want to make sure that all the pages you expected to be preloaded are referred to in the log and that there are no lines indicating files are being deleted (note: remove directory indicates it will be removed if it is empty and is not something to be worried about).

Caching disabled for logged-in users

Debug Log example:

10:35:40 2943444 /favicon.ico wpsc_get_auth_cookies: cookies detected: wordpress_logged_in_xxxxxx
10:35:40 2943444 /favicon.ico wpsc_is_caching_user_disabled: true because logged in
10:35:40 2943444 /favicon.ico Caching disabled for logged in users on settings page.
10:35:40 2943444 /favicon.ico wp_cache_get_cookies_values: Login/postpass cookie detected

WP Super Cache isn’t caching because the user is logged in. The Debug Log flags to this on lines 2 and 3, specifically in line 3, where the logs says: Caching disabled for logged in users on settings page.

To fix this, you need to enable caching for logged-in users in WP Super Cache’s settings.

Not caching due to POST request

Debug Log example:

07:47:04 3675 /wp-admin/admin-ajax.php Not caching wp-admin requests.
07:47:09 26206 / wpsc_get_auth_cookies: no auth cookies detected
07:47:09 26206 / wpsc_is_caching_user_disabled: false
07:47:09 26206 / wp_cache_get_cookies_values: return:
07:47:09 26206 / supercache dir: ABSPATH/wp-content/cache/supercache/example.com/
07:47:09 26206 / No Super Cache file found for current URL: ABSPATH/wp-content/cache/supercache/example.com/index-https.html
07:47:09 26206 / wp_cache_get_cookies_values: return:
07:47:09 26206 / In WP Cache Phase 2
07:47:09 26206 / Setting up WordPress actions
07:47:09 26206 / Created output buffer
07:47:09 26206 / wp_cache_get_cookies_values: return:
07:47:09 26206 / wpcache_do_rebuild: doing rebuild for ABSPATH/wp-content/cache/supercache/example.com/
07:47:10 26206 / Not caching POST request.
07:47:10 26206 / wp_cache_maybe_dynamic: returned $buffer

Looking at the Debug Log, WP Super Cache isn’t caching the homepage as shown here: 07:47:10 26206 / Not caching POST request.

This is happening because another plugin or theme is populating the _POST array, leading WP Super Cache to think the page has a POST request and isn’t caching it. The solution is to check for a plugin or theme conflict.

Still need help?

If you need assistance interpreting the debug log, search the WP Super Cache forums on WordPress.org. There is likely a past thread that can help explain what you are seeing.

Alternatively, please contact support. We’re happy to advise.

  • Table Of Contents

  • Contact Us

    Need more help? Feel free to contact us.