WP Super Cache is one of most popular Plugins for WordPress sites / blogs and perhaps the most popular caching plugin ever. In case you are facing performance issues with your WordPress blogs or sites and don’t use a caching plugin yet, WP Super Cache may be your best bet to “peace of mind”. In this tutorial we will tell you how to configure Super Cache for best possible performance using the most advanced “Mod_Rewrite” method. While Mod_rewrite is deemed more complex to configure than other two possible options it is simply the best. This is again based on our own experience of using WP Super Cache on our own blogs.
How to Install:
Go to Plugins–>Add New and install WP Super Cache.
How to Configure:
Activate WP Super Cache after installing. Go to Settings–>WP Super Cache from Dashboard menu.
The first tab is “Easy”. You can just put Caching on and save and it will enable “PHP caching” by default. Here you can see two more options “Test Cache” and “Delete Cache”. Once you configure everything you can test caching by using “Test Cache”.
Now go to Advanced tab. Check all the below options as seen in the screenshots below.
- Cache hits to this website for quick access
- Use Mod_rewrite to serve cache files
- Compress pages so they’re served more quickly to visitors
- Don’t cache page for known users
- Cache Rebuild
- Mobile Devices support
- Extra Homepage checks
- Only refresh current page when comments made
One you have checked all the above options and saved you will get a message to update Mod_Rewrite rules. Click on “Update Mod_Rewrite Rules” options as shown in below screenshot to update the rules that the plugin has created based on above settings.
Expiry time and Preload:
As can be seen in the above screenshot you can choose your Expiry time to be anything but we recommend it to be around 3600 sec. Select “Clock”, choose interval as per your comfort and save the settings.
Now go to Preload tab and choose to preload cache by putting a value other than zero in “Refresh preloaded cache files”. We recommend it to be set higher so that Plugin can server super cache files to reduce server load. You can decide how many posts you want to preload. If you have too many posts and have a shared hosting you may like to choose onlt the latest 2000-3000 posts. If you are on VPS / Dedicated server you can load all the posts.
The Preload settings shown in below screenshot work fine and can be used. After saving the settings, click on “Preload Cache now”.
Why Preloading Cache doesn’t affect user experience here:
For your information with Preload mode on the Super Cache files won’t be deleted until the time it refreshes itself, so you may think Users will be shown stale files. If you check settings done above
- With posting of comment the post cache will be deleted
- You can delete Home Page Cache after posting a new post
- If you make changes to any post or page just delete its cache
In this way, with Preloading of cache your server load remains low and at the same time, User gets to see the pages / post the way they are with comments. See below screenshot for the option of “Delete Cache” on every post or page that allows one to delete Cache of individual pages.
Check whether caching is working:
Go to content tab and tap on “Regenerate Cache contents” to see the number of Cached files. In case you want to see the listing of files you need to tap on list files.
Do let us know what you think about this tutorial and post any thing that you want to ask in comments below.