The WordPress Object Cache, Explained (and Why Redis Makes or Breaks It)
Every WordPress request answers hundreds of small questions: what options are set, what does menu item 7 contain, who is user 3. Without an object cache, each answer costs a MySQL query, every request, forever. The object cache is WordPress remembering answers instead of re-asking — and it is the single highest leverage performance layer most sites never configure properly.
Two very different caches
Page caching stores whole HTML pages and works brilliantly for anonymous visitors. But WooCommerce carts, checkouts, logged-in users and wp-admin cannot be page cached — exactly the requests that matter for a store. That is object cache territory: it accelerates the dynamic requests page caching cannot touch.
Non-persistent by default
Out of the box the object cache lives only for the duration of one request, in PHP memory. Useful, but the memory is wiped after every response and the next request re-asks everything. A persistent object cache — Redis via an object-cache.php drop-in — carries those answers across requests. Typical result on a WooCommerce site: dozens fewer queries per request and noticeably faster wp-admin, checkout and cart.
How the drop-in works
WordPress checks for wp-content/object-cache.php on every load. If present, it replaces the built-in cache — every wp_cache_get and wp_cache_set flows through it to Redis. This power is also the risk: the drop-in runs before almost everything else, on every request. If it fatals, your site fatals.
What to demand from a Redis drop-in
- Graceful failure — Redis down must mean cache misses, never white screens. Test with redis-cli shutdown on staging.
- A circuit breaker — during an outage, stop paying connection timeouts on every cache call; probe for recovery instead.
- Self-healing — the cache should return by itself when Redis does, without a human reactivating anything.
- Visibility — hit ratio, latency and an event log; a cache you cannot observe is a cache you cannot trust.
- Scoped flushes — a unique key prefix so flushing your site does not flush every site sharing the Redis instance.
Do you need it?
Static brochure site behind full-page cache: probably not. WooCommerce store, membership site, anything with logged-in traffic or heavy wp-admin use: yes — and you will feel the difference the same day you enable it.
Resilient Object Cache implements everything above — graceful drop-in, circuit breaker, auto-healing watchdog and a live health dashboard, free. See Resilient Object Cache →