Installing WP Super Cache

WordPress is a great piece of software and works well, however once your site starts to get a significant amount of traffic, it can become inefficient. Whenever someone views a page it has to be processed by PHP and then served via Apache. These can consume vast amounts of memory if your site gets even a moderate traffic spike. If one of your posts gets slashdot'd or on Digg, well, let's just say things won't be pretty.

WP Super Cache helps solve this problem by serving cached static files instead. This will both help your site survive large traffic spikes and help it to behave nicely in DreamHost's shared hosting environment. To get a better idea of how this all works, you can take a look at the WordPress Optimization page.

= Configuring WordPress Permalinks =

WP Super Cache requires you to be using any permalinks except the default 'ugly' ones. To change this, go to your admin panel and go to the Settings -> Permalinks area. Any of the options aside from "Default" will work, so your settings should look something like this:



= Installing WP Super Cache =

If you have previous installed any other caching plugin, you should deactivate and remove it. While some work well with SuperCache, others do not. Known plugins that conflict are WP Cache and W3 Total Cache. Make sure you remove them fully before installing WP Super Cache.

You can download the WP Super Cache plugin from the WordPress.org plugin respoitory, however you can also install it via your WordPress Admin Dashboard. Go to yourdomain.com/wp-admin, click on the sidebar link for Plugins, and then on the "Add New" button.

Search for WP Super Cache (or wp-super-cache, both work)



Click on Install for WP Super Cache (and click 'Ok' on the popup of 'Are you sure...?')

This will install WP Super-Cache and allow you to activate it right away.



= Activating WP Super Cache =

If you didn't click on Activate Plugin in the previous screen, you will need to go to the Plugins area of your admin dashboard (Plugins -> Installed Plugins) and click on activate. When you've done that, you should see something like this:



As you can see above, WP Super Cache is disabled by default. Go ahead and click on the "plugin admin page" link at the top of the page to get to the WP Super Cache configuration page. From there, you'll want to adjust your settings to look something like the below:



WP Super Cache will automatically add a line to your wp-config.php file, and it will write to your .htaccess if you select that option. When it fails to do so, it helpfully shows you links to it's own troubleshooting documents.

= Verifying WP Super Cache is Actually Working =

While you're on the WP Super Cache admin page, there's a button called 'Test Cache' - clicking on that will test if WP Super Cache is functional.



Click on the button for output:



= Caching Types =

While WP Super Cache supports three modes, it defaults to PHP:


 * Mod_rewrite Mode
 * PHP Mode
 * Legacy Mode

You can change these in the Advanced Settings tab:



There are pros and cons to each, however in terms of performance, if your content is not going to change that often, you will likely want to use Mod_rewrite mode, as it will speed up the TTFB (Time to first byte) 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 serves the HTML by itself.

If you're using nginx, you'll want to use PHP Mode. Generally no one ever wants to use Legacy.

mod_rewrite Mode
If you switch to using Mod_rewrite, you will be prompted to update your .htaccess file:



To do this, scroll down on the Advanced Page to where you see a large section in orange background. At the bottom of that is a button:



Click that and your .htaccess will be updated!



= Google PageSpeed =

WP Super Cache works excellently with Google PageSpeed, and if you're using it, you will not need to use a minification plugin, as you can use PageSpeed to do that instead.

= See Also =
 * Wordpress performance
 * WordPress Optimization
 * WP Super Cache Homepage
 * WordPress.org's WP Super Cache listing