RevealTheme logo
Back to Blog

Redis vs Memcached for WordPress Object Caching

Redis vs Memcached for WordPress Object Caching
The RevealTheme Team

By

·

If you have already decided you want object caching on your WordPress site and you are now staring at a host dashboard that offers both Redis and Memcached, here is the short version: pick Redis, and stop worrying about it. The engine you choose is one of the least consequential decisions in the whole object-caching setup. What actually moves the needle is the part nobody asks about, the connection layer between PHP and the cache. This article explains why that is true by looking at how these two systems are built, where the difference between them genuinely shows up, and what to configure once you have made the call.

What object caching does, and why the engine barely matters

A typical WordPress page assembles itself by running dozens to hundreds of database queries, options lookups, term relationships, post meta, transients, user capabilities. A persistent object cache keeps the results of those lookups in RAM so the next request reads them from memory instead of re-querying MySQL. On a busy site this collapses 150 to 300 queries per page into a small handful and trims real time off your time to first byte, often in the 100 to 400 ms range for query-heavy pages.

Notice what WordPress is actually asking the cache to do: store a serialized blob under a key, fetch it back, and occasionally delete it. That is it. WordPress does not use sorted sets, pub/sub, Lua scripting, or any of the data structures that make Redis interesting as a general-purpose datastore. It treats both Redis and Memcached as a dumb key-value box. Once you understand that the workload is pure GET, SET, and DELETE on opaque strings, the marketing differences between the two engines mostly evaporate.

The real architectural difference

The one structural distinction worth knowing is threading. Memcached is multi-threaded; it can spread concurrent connections across CPU cores. Redis executes commands on a single thread (network I/O has been threaded in recent versions, but command execution is still serialized). In theory this means Memcached can edge ahead under very high concurrent key-value load on a multi-core machine.

In practice, this advantage almost never surfaces on a WordPress site, because object-cache traffic is tiny relative to what either engine can handle, and a single Redis thread saturates well past the throughput a normal WordPress install generates. The single-threaded model also gives Redis a virtue that matters more here: predictable, low-variance latency, with no lock contention to reason about. So the honest framing is not "Redis is faster" or "Memcached is faster." It is: for WordPress, both are so far below their ceiling that the architectural gap is invisible. Redis additionally offers persistence and richer data types, neither of which WordPress's object cache needs, which is why Memcached's relative simplicity does not buy you anything in return.

The decision that actually matters: the PHP client

Here is the part that gets skipped. WordPress does not talk to Redis directly. It talks through a PHP client library, and which client you use has a larger performance impact than Redis versus Memcached ever will.

  • PhpRedis is a compiled C extension (a PECL extension) that runs at native speed. This is what you want.
  • Predis is a pure-PHP client. It works anywhere without a server extension, which is why some shared hosts default to it, but it is meaningfully slower and is no longer actively maintained.
  • Relay is a newer PHP extension that keeps a copy of the cache in PHP's own shared memory, avoiding the round trip to Redis entirely for many reads. It is the fastest option in 2026, though it requires installing the extension and pairs best with the commercial Object Cache Pro plugin.

The widely used Redis Object Cache plugin by Till Krüss supports all three and automatically prefers PhpRedis when the extension is present, falling back to Predis only when it is not. The practical consequence: if your host has not installed the PhpRedis extension, enabling Redis will still "work," but you are running on the slow path and leaving most of the benefit on the table. Before you obsess over the engine, confirm your host has PhpRedis installed. On the plugin's status screen it will report the active client. If it says Predis, that is your real problem, not your choice of engine.

Where the engine choice genuinely shows up

There are a few situations where the Redis-versus-Memcached distinction stops being academic:

  1. WooCommerce and high write concurrency. Stores with lots of simultaneous cart and session writes benefit from Redis's atomic operations and its more sophisticated handling of cache invalidation. Memcached's lack of native persistence and its eviction behavior under memory pressure can also cause more cache misses on a busy store.
  2. Cache stampedes. When a popular key expires and many requests try to regenerate it at once, Redis's richer primitives make it easier for caching plugins to implement locking. Pure Memcached gives you fewer tools to prevent the thundering herd.
  3. Multisite networks. Large multisite installs lean on object caching heavily and tend to be deployed on hosts that ship Redis anyway, so the question rarely comes up, you get Redis by default.

For a standard blog, brochure site, or modest membership site, none of these apply, and either engine performs identically from the visitor's perspective.

The Redis vs Valkey footnote you should know about

One thing that has shifted since older comparisons were written: in 2024 Redis changed its license from the permissive BSD to the more restrictive SSPL, and the community responded by forking the last open version into Valkey, now stewarded by the Linux Foundation. Valkey is a near drop-in replacement, WordPress object-cache plugins treat it identically, and benchmarks put it within a few percent of Redis either way. Several managed providers, including DigitalOcean and the major cloud caches, have already migrated their "managed Redis" products to Valkey under the hood. For you as a WordPress operator this changes nothing operationally: if your host's dashboard says Redis or says Valkey, enable it, point the same plugin at it, and move on. It is worth knowing only so the naming does not confuse you when a host quietly relabels the service.

What to actually do

Object caching is invisible to anonymous visitors served from page cache, but it is the single biggest win for logged-in users, WooCommerce sessions, and any dynamic page that cannot be fully page-cached. Here is the sequence that matters:

  • Enable whatever your host offers. In 2026 that is almost always Redis or Valkey; Memcached has become the less common managed option. If both are offered, choose Redis. If only Memcached is offered, use it, it is completely fine for a typical site.
  • Verify the C extension. Confirm PhpRedis (or Relay) is installed, not Predis. This matters more than the engine.
  • Install the drop-in. Use Redis Object Cache by Till Krüss, enable the drop-in from its settings page, and confirm it reports a "Connected" status with the right client.
  • Leave invalidation alone. Modern WordPress and modern plugins invalidate object-cache entries correctly. Only a handful of older WooCommerce or SEO extensions from the late 2010s have documented quirks. Keep the plugin's "Flush Cache" button in mind for the rare stale-data moment.

If your host supports neither, you can fall back to file-based object caching (W3 Total Cache supports it), which is slower than RAM but still real, expect a smaller TTFB improvement in the 50 to 150 ms range. And remember object caching is not the same as page caching: page caching serves finished HTML to anonymous visitors, while object caching speeds up the database work behind every request, including the dynamic ones page caching can never touch. You want both. The Redis-versus-Memcached question, meanwhile, deserves about thirty seconds of your attention, spend the rest of it making sure the right client library is doing the work.