«
»

How to enable WP-Super-Cache in WordPress

November 29th, 2008 by George Notaras

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.X.X.X.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.X.X.X.zip
unzip wp-super-cache.X.X.X.zip
rm wp-super-cache.X.X.X.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.

The How to enable WP-Super-Cache in WordPress by George Notaras, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Terms and conditions beyond the scope of this license may be available at www.g-loaded.eu.

Related Articles

Tags: , ,

Bookmark and Share

2 Responses to “How to enable WP-Super-Cache in WordPress”

  1. Budi Says :

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

  2. Alexandre Baaklini Says :

    Hi George,
    you made a great job here.
    My WP Super Cache installation was flawless.
    Thanks a lot

Comments are automatically disabled after a certain period of time. Further discussion about the published content is still possible though in the G-Loaded Forums.