Page caching gets all the glory in WordPress performance discussions, but it has a blind spot: it only helps anonymous visitors viewing cacheable pages. The moment someone logs in, adds to a cart, or views anything personalized, page caching steps aside — and every one of those requests hits your database at full cost. That is the gap object caching fills.
This guide explains object caching in WordPress from first principles: what it stores, how Redis and Memcached differ, when your site actually needs one of them, and how to deploy it without breaking things.
The Problem Object Caching Solves
WordPress is a database-intensive application. Rendering a single page can trigger dozens or hundreds of database queries: the main content query, menu items, widgets, options, metadata for every post shown, and whatever your plugins add. Many of these queries return identical results on every request — the site’s options, the navigation menu structure, the list of categories.
Without object caching, WordPress runs all of those queries fresh on every page load, for every visitor. With object caching, the results of expensive queries and computations are stored in fast memory. The next request for the same data gets it from memory in microseconds instead of waiting on the database. The database still holds the truth; the object cache just stops WordPress from asking the same questions repeatedly.
How WordPress Uses the Object Cache
WordPress has a built-in object cache API — WP_Object_Cache — that core, themes, and plugins use to store arbitrary data under named keys, grouped for organization. Transients, the options cache, and metadata caches all flow through it. By default, this cache lives only for the duration of a single request: it is stored in PHP memory and thrown away when the request ends. That helps within one page load but does nothing for the next visitor.
A persistent object cache backend — Redis or Memcached — replaces that throwaway storage with a shared memory server that survives across requests. Now when visitor A triggers an expensive query, visitor B, C, and D get the result from memory. This is the entire trick, and it is remarkably effective for database-heavy workloads.
Transients vs the Object Cache: Clearing Up the Confusion
WordPress developers constantly mix up two related but distinct systems: the Transients API and the object cache. Understanding the difference saves real debugging pain.
Transients are a high-level API for storing temporary data with an expiration time — “remember this API response for one hour.” Under the hood, transients use the object cache when a persistent backend exists, and fall back to the database options table when it does not. This fallback is the critical detail: on a site without Redis or Memcached, every transient is a database row, and transients that never expire (or whose expiration is mishandled) accumulate in the options table as permanent clutter.
The object cache itself is the lower-level storage: named keys in groups, no inherent expiration semantics beyond what the backend provides. Core and plugins use it directly for things like parsed menu structures and metadata that are recomputed cheaply.
Practically, this means two things. First, installing a persistent object cache automatically upgrades all your transients from database rows to memory — often the single biggest database relief on the site. Second, audit expired transients periodically: on sites that ran for years without an object cache, the options table is frequently bloated with thousands of expired transient rows that nothing ever cleaned up, and removing them is safe, instant relief.
Redis vs Memcached: An Honest Comparison

Both are in-memory data stores. Both work well as WordPress object cache backends. Their differences matter at the margins:
Redis
- Data structures: supports strings, hashes, lists, sets, and sorted sets. WordPress primarily uses simple key-value storage, so this is mostly future-proofing rather than a daily advantage.
- Persistence options: can snapshot data to disk, so a cache server restart does not necessarily mean a completely cold cache.
- Replication: built-in replica support for larger setups.
- Memory management: configurable eviction policies for when memory fills up.
Memcached
- Simplicity: a pure key-value cache with a smaller feature surface. Less to configure, less to go wrong.
- Multithreaded: handles high concurrency efficiently on multi-core servers.
- Battle-tested: one of the oldest and most deployed caching systems in existence.
For a typical WordPress site, either one will serve you well — the performance difference between them is negligible compared to the difference between having a persistent object cache and not having one. Choose based on what your hosting environment supports and what your team knows how to operate. If your host offers one of them as a managed service, take it and move on.
When Do You Actually Need Object Caching?
Not every site needs it. Here is how to tell:
- High database query counts: if your pages run hundreds of queries (visible in debugging tools), object caching will cut that dramatically on repeat requests.
- Logged-in traffic: membership sites, forums, learning platforms, and dashboards bypass page caching — object caching is often their biggest available win.
- WooCommerce and dynamic sites: carts, account pages, and personalized content cannot use page caching; object caching speeds up everything underneath them.
- High traffic: as concurrent visitors grow, repeated identical queries become a database bottleneck. Object caching absorbs that load in memory.
- Slow or distant database: if the database server is under-provisioned or network-distant, avoiding queries matters even more.
Conversely, a small brochure site with a good page cache and modest traffic may see little measurable benefit. Object caching is a tool for specific workloads, not a mandatory checkbox.
Pro tip: enable query monitoring on a staging copy first and record your query count and database time per page. After enabling the object cache, compare. The numbers will tell you exactly what it bought you — no guessing required.
Setting It Up the Right Way
A correct deployment has four parts. Get any of them wrong and you will have a bad time:
- The cache server itself: Redis or Memcached must be installed, running, and reachable from your web server — ideally on the same machine or private network. It needs enough memory for your dataset with headroom; an undersized cache that constantly evicts is barely better than none.
- The PHP extension: PHP needs the matching client extension to talk to the cache server. This is server-level work, typically handled by your hosting provider.
- The WordPress drop-in: a small object-cache.php file in your wp-content directory wires WordPress’s cache API to the backend. This is the piece that makes WP_Object_Cache persistent.
- Cache key salting: if multiple WordPress sites share one cache server — common on shared hosting — each site must use a unique key prefix. Without it, sites overwrite each other’s cached data, producing spectacular and confusing bugs.
What Object Caching Will (and Will Not) Fix

Set expectations correctly. Object caching will:
- Drastically reduce database queries on repeat requests
- Speed up wp-admin, which is never page-cached
- Lower database server load, improving stability under traffic spikes
- Make database-heavy plugins dramatically cheaper to run
It will not:
- Fix slow PHP code — an expensive computation still runs the first time
- Reduce page weight or fix render-blocking assets
- Help much if your bottleneck is the theme’s frontend, not the database
- Replace page caching for anonymous traffic — use both, they complement each other
Monitoring and Maintenance
An object cache is infrastructure, and infrastructure needs watching. Monitor the hit rate — the percentage of requests served from cache. A healthy WordPress object cache typically shows hit rates above 90 percent after warmup. A low hit rate means your cache is too small, your keys are expiring too fast, or something is flushing the cache constantly.
Watch memory usage and evictions. Occasional evictions under load are normal; constant eviction means the cache is undersized. And be cautious with plugins or workflows that flush the entire object cache frequently — each full flush throws away all accumulated benefit and forces a cold rebuild. Targeted invalidation beats global flushes every time. When sizing the cache server, start by observing your dataset size under realistic traffic for a full day, then provision roughly twice that — memory is cheap compared to the database load it prevents.
Deployed thoughtfully, a persistent object cache is one of the highest-leverage improvements available to a database-heavy WordPress site. It does not change what your site does — it just stops your server from doing the same expensive work twice.
