Configuring WP Super Cache

 

Overview

This article explains how to optimize the WP Super Cache plugin after installing it to your site.

Configuring the plugin

To configure the WP Super Cache plugin:

  1. Log in to your WordPress dashboard.
  2. Navigate to the Settings > WP Super Cache section.
  3. Select the Advanced tab and make sure the following options are checked/enabled:
    • Caching: Enable Caching
    • Cache Delivery Method: Expert. This option adds rules to the site's .htaccess file
    • Miscellaneous / Cache Restrictions:
      • Disable caching for logged in visitors.
      • Don't cache pages with GET parameters.
      • Compress pages so they're served more quickly to visitors.
      • Cache rebuild.
    • Advanced
      • Extra homepage checks.
  4. Click the Update Status button, which refreshes the page.
  5. Scroll down to Rejected URL Strings section and make sure the following exclusions are included within the text box:
    wp-.*\.php
    index\.php
    /store
    /cart
    /checkout
    /my-account
    /feed
    /addons
    /administrator
    /resetpass
    /register
    /login
    /mepr
    /account
    /thank-you
    /ref
  6. Click the Save Strings button and wait for the page to refresh.
  7. Open the Easy tab and scroll down to the Cache Tester section.
  8. Click the Test Cache button and wait for the results. The following message appears, which indicates that your setup has been successfully configured:
    The timestamps on both pages match!

Managing the cache

The following sections explain how to test or change the type of cache the plugin uses.

Testing the plugin

  1. Log in to your WordPress dashboard.
  2. Navigate to the Settings > WP Super Cache section.
  3. Select the Easy tab.
  4. Click the Test Cache button.
    The following appears:
    10 WP Super Cache.fw.png

Timestamps differ or were not found error

You may see the following error message when you test your cache:

The pages do not match! Timestamps differ or were not found!

This is a Cloudflare Minify issue and occurs when you have enabled Cloudflare on your domain. To fix:

  1. Log into your Cloudflare account.
  2. In the left menu, click the Speed tab and then click Optimization.
  3. Scroll down to the Auto Minify section and un-check the HTML option.
  4. Open the Caching tab and then click Configuration.
  5. In the first section, click the Purge Everything button.
  6. Wait at least 30 seconds and then test your cache again in WordPress. It should now show that the timestamps match.

Changing the caching type

Open the Advanced tab to view the various caching types. WP Super Cache supports two modes:

Simple

If you're using Nginx, use the Simple option instead.

Expert (mod_rewrite) 

If performance is a priority or if your content is not updating that often, use the Expert (mod_rewrite) option, which speeds up the Time to First Byte (TTFB) by orders of magnitude. This is because it doesn't have to search for additional PHP handlers to parse the cached file. Instead, it writes the content as raw HTML and then serves the HTML by itself.

Making WP Super Cache work with Nginx

To use WP Super Cache on an Nginx server, you must update a configuration file. 

  1. Log in to your server via SSH.
  2. Navigate into the following directory. Change the username to your shell user and example.com to your website:
/home/username/nginx/example.com/wordpress.conf

Add the following lines to the wordpress.conf file in this directory:

###### rest of wordpress.conf above...
###
# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
  rewrite ^(.*)$ $supercache_file break;
}

### stats
if ($request_uri ~* ^/(stats|doc|failed_auth\.html).*$) {
  break;
}

# all other requests go to WordPress
if (!-e $request_filename) {
  rewrite ^.*$ /index.php last;
}

See also

DreamHost links

Third-party links

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?