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:
- Log in to your WordPress dashboard.
- Navigate to the Settings > WP Super Cache section.
- 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.
- Click the Update Status button, which refreshes the page.
- 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
- Click the Save Strings button and wait for the page to refresh.
- Open the Easy tab and scroll down to the Cache Tester section.
- 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
- Log in to your WordPress dashboard.
- Navigate to the Settings > WP Super Cache section.
- Select the Easy tab.
- Click the Test Cache button.
- The following appears:
-
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:
- Log into your Cloudflare account.
- In the left menu, click the Speed tab and then click Optimization.
- Scroll down to the Auto Minify section and un-check the HTML option.
- Open the Caching tab and then click Configuration.
- In the first section, click the Purge Everything button.
- 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.
- Log in to your server via SSH.
- 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
- Installing WP Super Cache
- How to log into your WordPress site
- Managing WordPress plugins
- WordPress caching options
Third-party links