WordPress Caching, Part 1: The Basics
Caching (on the internet) is the act of storing computationally expensive calculations in a way that can be recovered very quickly with the smallest possible impact on the server.
Or, in short, ‘speeding stuff up’.
In this series of posts I will be showing you how you can speed up your WordPress blog. I’ll start with the basics and then move on to how I cache external data in my WordPress theme – Elemental.
By far the most popular caching plugin is WP_Super_Cache, but there is a new plugin which I have tested recently called W3 Total Cache.
WP_Super_Cache is a plugin that stores copies of your generated pages as flat html files. This then means that, unless something changes (new post/ comment), subsequent visits do not need to touch the database saving a lot of processing and generally speeding up your website.
WordPress built in caching
Something many WordPress developers don’t realise is that WordPress has caching functionality built-in.
Ever since WordPress version 2.0 there has been a caching class used to store previously calculated data. However these are best used when combined with server software such as Memcached or APC to speed up the site massively. Unfortunately many users, especially those on shared hosts, can’t use these services which is one of the reasons plugins like WP_Super_Cache have become so popular.
Any caching you can add to your website will improve performance, and this series will focus on the types of caching that can be applied to plugins and themes, that will benefit everyone. Caching that will speed up any blog – including those on shared hosts that do not have access to MySQL/ PHP settings, or the ability to install software such as Memcached and APC.
In WordPress Caching, part 2, I am going to show you how you can make use of the built-in caching to speed up your themes and plugins, even if you don’t have the server-side software (such as Memcached) installed.