UPGRD
← Home

Web Engineering

When Redis Makes WordPress Slower Instead of Faster

A persistent object cache can substantially improve WordPress performance, but excessive cache operations, serialization and network round trips can also become bottlenecks.

Home · · 5 min read · Updated November 26, 2026
  • WordPress
  • Redis
  • PHP
  • Profiling
  • Object Cache
  • TTFB
Application architecture linking PHP requests, a Redis object cache and a relational database.

Quick summary

A persistent object cache can substantially improve WordPress performance, but excessive cache operations, serialization and network round trips can also become bottlenecks.

A persistent object cache is often introduced to reduce repeat database work in WordPress. It can help: WordPress’s default object cache lasts only for the duration of a request, while a persistent cache plugin can retain values across page loads. But adding Redis does not make every request cheaper by definition. A request that performs many remote lookups, serializes large objects, or misses frequently can spend meaningful time operating the cache it was meant to benefit from.

The right measure is total request cost: database work avoided, plus cache calls, serialization, network transport, PHP work, and any effects on tail latency. A high hit ratio by itself cannot tell you whether the cache made a page faster.

Count operations, not just hits

Suppose a request issues 3,000 sequential Redis operations and each round trip takes 0.2 milliseconds. The arithmetic is 600 milliseconds of round-trip time if those calls are serialized: 3,000 × 0.2 ms = 600 ms. This is an illustrative calculation, not a measurement of WordPress, Redis, or any plugin. Actual requests can pipeline commands, use different network paths, and incur variable client, server, and serialization costs. Still, it demonstrates why many individually small calls can add up when each waits for a response before proceeding.

Hit ratio is also a weak proxy for value. A cache hit on a cheap computation may save less than the cost of reading and decoding its cached representation; a miss might add a Redis lookup before the database query still has to run. On the other hand, one hit that prevents a costly query could be valuable. Look at keys and operations in the request call graph: which code asks for them, how many requests occur, what size values move, and how expensive would regeneration or the database lookup really be?

WordPress’s object-cache APIs include multi-key functions such as wp_cache_get_multiple() and wp_cache_set_multiple(). Whether these reduce network overhead depends on plugin support and implementation; WordPress recommends checking support through wp_cache_supports() for optional capabilities rather than assuming every persistent-cache drop-in implements them efficiently. A request-local in-process cache can also avoid repeatedly fetching a value already obtained during that same request, provided freshness and invalidation semantics remain correct.

Serialization and value shape matter

Redis stores byte-oriented values, while WordPress applications generally work with PHP values and objects. A cache drop-in must encode and decode those values, and large or deeply structured payloads can consume CPU and memory even when Redis responds quickly. Repeatedly storing whole post objects or query result structures where a smaller derived value would suffice can increase transfer and allocation costs. There is no universal “Redis is fast” threshold: local versus remote placement, TLS, connection reuse, PHP client, object size, command pattern, and workload concurrency all affect the end-to-end path.

Instrument from the PHP request outward. Use a staging copy with representative plugins and content. Profile wall time by call site, count object-cache operations per request, record serialized payload sizes where practical, and compare database query count and duration. TTFB should be measured at the same layer and under the same conditions for each variant; distinguish origin response time from browser or CDN time. Verify that a full-page cache is bypassed or held constant, since it can conceal the cost of PHP and object-cache changes entirely.

Use Redis diagnostics as clues

redis-cli INFO stats and redis-cli INFO commandstats expose server statistics and command-level counts and timing that can help identify a disproportionate command mix. They are server-wide or cumulative views, not request traces: correlate them with a controlled interval and application-side observations. redis-cli SLOWLOG GET 20 can show recent commands exceeding the configured slow-log threshold, but Redis documents that slow-log execution time excludes client I/O such as talking to the client and sending the reply. Therefore, an empty or unremarkable slow log does not rule out network round-trip cost, PHP serialization, connection setup, or a large number of fast sequential calls.

redis-cli LATENCY DOCTOR analyzes events recorded by Redis latency monitoring; it is only informative when monitoring is configured and relevant events have been captured. Check the latency-monitor threshold and environment rather than treating the command as an always-on transaction profiler. Redis itself may be responsive while PHP waits on repeated network exchanges. Conversely, high Redis command latency can reflect expensive commands, large values, resource contention, persistence activity, or other server-side causes and deserves separate diagnosis.

redis-cli INFO stats
redis-cli INFO commandstats
redis-cli SLOWLOG GET 20
redis-cli LATENCY DOCTOR

Run a controlled comparison

In staging, replay identical anonymous and authenticated requests against a fixed dataset, with the same PHP workers, database, network path, and request concurrency. Compare the object cache enabled and disabled, and include a warmed-cache state where that reflects production. Keep full-page caching consistently bypassed or enabled in both cases; otherwise the page cache may make the object-cache change invisible. Record request latency percentiles and TTFB, throughput, PHP CPU and memory, database query count/time, Redis command counts, and relevant Redis latency. Repeat the scenario enough to see variability, and avoid flushing shared production data to create a test condition.

Pay attention to cold misses as well as warm hits. A cache can reduce database load after warm-up while making cache-cold requests more expensive. A changed content pattern, invalidation storm, or deployment can repeatedly push traffic back into a cold state. Measure what the actual workload experiences, not just a micro-test of a single Redis command.

Optimize the call graph, not the cache label

If Redis adds cost, find the source before changing infrastructure. Reduce duplicate reads within a request, batch related operations when the drop-in supports it, avoid caching values whose computation is already cheap, and right-size objects to what callers use. Check key churn, cache misses, serialization time, and connection handling. Then verify invalidation and consistency behavior: a faster stale response is still wrong.

Redis object caching is useful when the work it avoids exceeds the costs it introduces. Treat it as another dependency in the request path, measure its contribution end to end, and optimize the work that consumes time. “More hits” is not the objective; faster, reliable requests are.

At the shared HTTP layer, request equivalence is another cache boundary: a cache key can become a security control.

References

WordPress object cache documentation; Redis INFO; Redis SLOWLOG GET; Redis LATENCY DOCTOR; Redis latency monitoring framework.