Page caching gets most of the attention, but it is not the only kind of cache in WordPress. The object cache works deeper inside, at the level of database queries.
In simple words, it stores the results of database queries and other costly tasks in memory. WordPress can then reuse them instead of asking the database again.
How the built-in object cache works
WordPress has an object cache built into core. When it loads an option or a post from the database, it keeps a copy in memory. If the same data is needed again during that page load, WordPress reads it from memory.
The catch is that this built-in cache is not persistent. It is cleared at the end of every request, so the next visitor starts from zero. It is just like a waiter who remembers your order during the meal but forgets it once you leave.
What is a persistent object cache?
A persistent object cache keeps that data between page loads. It uses a fast in-memory store such as Redis or Memcached running on the server. WordPress connects to it through a small drop-in file called object-cache.php in the wp-content folder.
This helps most where full page caching cannot do much, such as online stores, membership sites and forums. Pages there change for each logged-in user, so cached data saves many trips to the database. A slow admin area can also feel quicker. If your dashboard drags, our guide on fixing a slow WordPress admin dashboard has more tips.
How to enable object caching
- First, ask your host whether Redis or Memcached is available on your plan.
- Next, turn it on in your hosting control panel if needed.
- Now, install a plugin that connects WordPress to that service and enable it.
- Finally, check the plugin's status screen to confirm that it is connected.
If your site shows old data after a change, flush the object cache from the plugin's settings. Also, a simple blog with good page caching may not notice much difference.
Put simply, the object cache saves your database from answering the same question twice. If you have any doubts, drop them in the comment box below.