To load your WordPress site pages faster, one should install caching plugin. There are lot many caching plugins available for self hosted WordPress, but the popular ones are W3 Total Cache, WP Super Cache and Hyper Cache. Here I will talk about the most downloaded and widely used W3 Total Cache plugin and will detail out the customization and features available in this plugin. By the end of this post, you would be able to understand the purpose and functioning of W3 Total Cache plugin. I am pretty sure that you will see change in your WordPress site’s load time after installing this kind of caching plugin and proper customization.
Install and Activate W3 Total Cache
Download the plugin from plugin repository and install on your WordPress site hosting server. Installation is as simple as other plugin installation. You just need to copy the unzipped folder into wp-content/plugins folder in your site’s root. Now go to the dashboard ==> plugins menu, and activate “W3 Total Cache”.
If plugin gets activated without any problem, its fine. In case you are getting error saying that some changes required in the wp-config.php file, then you need to find the wp-config.php file in the root folder of the site and make required changes over there. Or you can make the wp-config.php writable to let the plugin make changes automatically.
Plugin Activated, now Customization
Alright folks, W3 Total Cache is successfully activated. Here is the first screen of W3 Total Cache which can be accessible from the new menu section named “Performance” which you can find below the “Settings” menu on Dashboard. Go ahead and click on “General Settings” to take a look at the common settings (default” done for your WordPress site.
By default, you will see following caching enabled.
- Page Cache
- Database Cache
- Object Cache
- Browser Cache
Page Cache Customization
You can manage your site’s pages caching from this particular option available under “Performance” tab. You can exclude any specific page from caching or even exclude cookies from caching as well. Set the cache expire time on this page. Default values are fine for normal sites with up to 10,000 visits per day. If you are seeing huge traffic on your site, then you may choose to reduce the value from 3600 seconds to lower.
Prime cache is also available in W3 Total Cache on Page Cache page. You can select to create more than one set of cache files by changing the interval of prime cache. Provide the sitemap URL of your site to let W3 Total Cache create cache files as per sitemap.
Combine and Compress HTML, JS with Minify
It is an awesome and effective feature available in W3 Total Cache. You can remove the blank lines from your site’s HTML and combine many JS into one to load the page much much faster. This change will not affect the PHP code into your site’s template files. You may choose to check all the options available on Minify page under HTML, JS and CSS customization.
Note: Test your site in “Preview” mode before deploying the changes.
Database Cache and Object Cache
W3 Total Cache can serve the database from caching system as well. For objects and database cache, the default value is totally fine. If you want to exclude any page or directory, you can use these pages to add them. This website offers ideas how to optimize this process.
Browser Cache to Gain good YSlow Score
Browser cache is very important in loading the site for more than one time. That means, if a visitor will come again to your site, he will find the pages loading much faster if your site’s browser cache is customized properly. Default options in browser cache section are good but you may choose to select each of them to have more faster site for users.
Content Delivery Network (CDN)
To serve the static pages much faster and to utilize the power of browser at max, you should use CDN. A browser can have more than 5 connections at a time and if you are using CDN, you can allow browser to load static files from other domains or sub-domain. This will make your site much faster. There are third party service available for CDN, for example MaxCDN or you can use Amazon S3 as CDN. You can also choose to serve from your hosting server by creating a sub-domain on your own domain. Create a sub-domain and point that to your site’s root folder. Now using that sub-domain as CDN, you can serve static content from there. Provide the URL of CDN in “Replace site’s hostname with” box. You can use more than one CDN to load from multiple sources.
User Agent Grouping
As W3 Total Cache can help your site caching files for mobile devices as well. If you are using any other plugin like MobilePress to serve mobile friendly pages, then W3 Total Cache can see the device user agent and find the type of device and does as per your instructions. You can group the devices or user agent in low end and high end devices and them either let the plugin redirect to some other pages or use caching for services like MobilePress.
W3 Total Cache is a nice plugin but it requires lot of CPU utilization. I would recommend to use W3 Total Cache on busy sites hosted on VPS or dedicated servers. If your site is hosted on shared hosting, use WP Super Cache.
Alright folks, this time I provided some details on the customization of W3 Total Cache plugin, wait for my take on WP Super Cache customization and benefits in few days.