How to enable WP-Super-Cache in WordPress

It was about time I started using a cache in WordPress. After doing some research, I found out that WP-Super-Cache is sophisticated enough and works quite well, judging by the posts of many satisfied users. In this post I will outline the installation procedure step-by-step, because the installation instructions of the README file were a bit confusing. I mainly post this for my own reference, but I am almost 100% certain that it will work for you too.

Requirements

Speaking about httpd (Apache), the following modules should be loaded:

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule mime_module modules/mod_mime.so

The modules above are so standard, that there is high probability that they are already loaded.

Installation

  • Before installing WP-Super-Cache, make sure you have properly uninstalled any other caching plugin. This step is not covered by this guide. Please, consult each plugin’s documentation.
  • Download the plugin (wp-super-cache.N.N.N.zip) and unzip it in your plugins directory, so that you have a directory structure like /wp-content/plugins/wp-super-cache/. Assuming you are in the root directory of your website (DocumentRoot):
cd wp-contents/plugins/
wget http://downloads.wordpress.org/plugin/wp-super-cache.N.N.N.zip
unzip wp-super-cache.N.N.N.zip
rm wp-super-cache.N.N.N.zip
  • Make the directory wp-content writeable by the Apache web server. If this is not possible, give write permission to the “world“. Do not worry, this is a temporary modification. Permissions will be reverted after we are finished. To enable write access for the the “world“:
chmod o+w wp-content
  • Go to the WordPress plugin administration panel and enable WP Super Cache
  • Then, edit wp-config.php and make sure you add the following line anywhere above the “require_once(ABSPATH.'wp-settings.php');” line
define( 'WP_CACHE', true );
  • Go to the plugin’s administration panel in WordPress (that will be under the Settings menu) and enable caching (that is in the very first configuration section “WP Super Cache Status“).
  • Put the mod_rewrite rules in the .htaccess file located in the root directory of your website. Make sure you paste them above WordPress’ rewrite rules. The plugin guides you in an excellent way for this, so follow the on-screen instructions. There are also some other settings that need to be placed in wp-content/cache/.htaccess, but these should have been created automatically.
  • Remove the write permission we had set in a previous step. If you had enabled it for the apache user, then remove it from that user. If you had enabled it for the “world“, do the following:
chmod o-w wp-content

The benefits of using the supercache are that your content is delivered fast and the system resources are not wasted. WP-Super-Cache creates and serves static versions (pure HTML) of your webpages and thus php is utilized less and less SQL queries are sent to your database server (MySQL, PostgreSQL, etc).

At this point, the plugin should have started caching your content as you visit web pages. Sit back and enjoy!

Upgrade WP-Super-Cache

For step-by-step instructions about how to upgrade WP-Super-Cache to newer versions, please read the “How to Upgrade WP-Super-Cache” article.

PS: The use of this plugin also implies that I have stopped using my Fast-Static-Feed plugin, since wp-supercache caches feeds too.

How to enable WP-Super-Cache in WordPress by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2008 - Some Rights Reserved

George Notaras avatar

About George Notaras

George Notaras is the editor of the G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.

2 responses on “How to enable WP-Super-Cache in WordPress

  1. Budi Permalink →

    Thanks for sharing this tutorial. It help me to add the plugin to my blog.