As a WordPress blog gains more visibility and followers, the load on the server increases and so does the bandwidth. If you are running a low power server that is not designed to handle the load or you are behind a network and have to watch your bandwidth then this post may come to your help. Even if the above statements are not true for you, this post may still benefit you by decreasing the page load times for your visitors and improve performance of WordPress blog.
As you may or may not know I am running an Dual Core Atom 330 based Ubuntu Server that works as a Media Center HTPC running XBMC, download station, network backup drive, and the file server. This is too much to ask from a small 6 Watt processor. Fortunately, my server can handle it. But I still have to try and make it as easy as possible for it.
After researching, I found that Caching is one of the easiest things you could do to achieve the above objectives and there are couple of WordPress plugins that could do this with just a few clicks. Caching works by storing frequently accessed files, pages, and database queries in the memory and serves them when they are requested again. The PHP page does not have to be processed again or the database does not have to be queried again, thereby saving some power and bandwidth and reducing page load times.
If you search WordPress plugin directory for cache plugins, several of them show up. The most popular ones are: WP Super Cache, Quick Cache, W3 Total Cache, WP Widget Cache, DB Cache Reloaded Fix, and several others. Some say they cannot be combined (for example, WP Super Cache has problems working in tandem with some of the other plugins). What I am going to describe are 2 caching plugins that are available today that have worked best for me with minimal work.
Quick Cache (Speed Without Compromise)
Quick Cache is truly a set it and forget type of plugin. All you have to do is install the plugin and enable it. Quick Cache starts doing its magic. I saw an instant increase in my page load speeds. The author describe the plugin as follows:
If you care about the speed of your site, Quick Cache is one of those plugins that you absolutely MUST have installed. Quick Cache takes a real-time snapshot (building a cache) of every Page, Post, Category, Link, etc. These snapshots are then stored (cached) intuitively, so they can be referenced later, in order to save all of that processing time that has been dragging your site down and costing you money.
The Quick Cache plugin uses configuration options, that you select from the options panel. See: Config Options under Quick Cache. Once a file has been cached, Quick Cache uses advanced techniques that allow it to recognize when it should and should not serve a cached version of the file. The decision engine that drives these techniques is under your complete control through options on the back-end. By default, Quick Cache does not serve cached pages to users who are logged in, or to users who have left comments recently. Quick Cache also excludes administrational pages, login pages, POST/PUT/GET requests, CLI processes, and any additional User-Agents or special pattern matches that you want to add.
Store Cache in RAM:
Follow this step only if you run your blog on your own Linux server. If you would like to go one step further you can store the cache in RAM memory, which is faster than a Hard Drive. Quick Cache requires you to create a
cache folder under
wp-content folder and give it write permissions. Therefore first cd into the
wp-content folder and create a the
mkdir cache chmod 775 cache
/etc/fstab as sudo using the following command:
sudo nano /etc/fstab
Add the following line:
tmpfs /PATHTOCACHEFOLDER/wp-content/cache tmpfs defaults,noatime,mode=1777 0 0
Remember to replace
PATHTOCACHEFOLDER with appropriate path information. For example, if your blog/website is located under
/var/www/myblog then the full path to the
cache folder would be
/var/www/myblog/wp-content/cache. Save and exit. After your next reboot your cache should now be stored in RAM memory, giving you that extra boost of speed.