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.
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.
- 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-contentwriteable 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.phpand make sure you add the following line anywhere above the “
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!
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