Redis vs Memcached: WordPress object caching compared
TL;DR: Both Redis and Memcached solve the same core problem for WordPress, storing the results of expensive, repeated database queries in memory so subsequent requests can skip hitting the database entirely, and both produce a similar, substantial performance improvement for object-caching purposes specifically. Redis has become the more commonly recommended default because it supports richer data structures, optional persistence to disk (surviving a server restart without a fully cold cache), and additional capabilities beyond simple key-value storage, while Memcached remains a simpler, slightly leaner pure caching layer that is entirely sufficient for many sites that do not need Redis's additional features.
What object caching actually solves
WordPress generates a large number of database queries for a typical page load, fetching post content, options, user data, and results from various plugin operations, and by default, many of these queries are re-executed fresh on every single request even when the underlying data has not changed since the last time the exact same query was run. Object caching addresses this specifically by storing the result of a database query in fast, in-memory storage the first time it runs, then serving that cached result directly for subsequent identical requests, entirely bypassing a repeated database round-trip, distinct from and complementary to page-level caching (covered in our full slow WordPress diagnostic guide), since object caching specifically benefits logged-in users, admin operations, and any request that cannot be served from a full-page cache but can still benefit from avoiding redundant database work.
What Memcached does
Memcached is a simple, purpose-built, distributed memory caching system storing data purely as key-value pairs, with a deliberately minimal feature set focused specifically and exclusively on doing this one job efficiently: fast storage and retrieval, automatic eviction of older data when memory limits are reached, and straightforward horizontal scaling by adding more Memcached instances if needed. It does not persist data to disk at all, meaning a server restart or a Memcached service restart clears the cache entirely, starting cold and needing to be repopulated from scratch as subsequent requests occur.
What Redis does differently
Redis supports the same basic key-value caching use case Memcached provides, but adds considerably more capability beyond it: richer data structures (lists, sets, hashes, sorted sets) allowing more sophisticated caching patterns than simple key-value pairs alone, optional persistence to disk (configurable to periodically save its in-memory state, meaning a restart does not necessarily mean starting from a completely empty cache), and additional features like pub/sub messaging and built-in support for certain atomic operations useful beyond pure caching, some of which specific WordPress plugins or custom functionality can take advantage of beyond basic object caching alone.
This broader feature set is the primary reason Redis has become the more commonly recommended default across the WordPress hosting ecosystem in recent years, not because it is dramatically faster than Memcached for the core, shared object-caching use case, where the two are broadly comparable, but because its additional capabilities provide more headroom and flexibility for a site's caching needs to grow without requiring a switch to a different technology later.
Persistence: the practical difference that matters most
For most WordPress sites specifically, the single most practically relevant difference is Redis's optional persistence capability. Since Memcached's cache is entirely cleared on any restart (whether a deliberate maintenance restart or an unexpected server issue), a site relying purely on Memcached experiences a "cold cache" period immediately after any such restart, during which every request that would normally be served instantly from cache instead falls back to a full, slower database query until the cache gradually repopulates through normal traffic. Redis, configured with persistence enabled, can avoid or substantially reduce this cold-start period by restoring its cached data from disk after a restart, a genuinely meaningful practical advantage for a site experiencing periodic restarts (routine server maintenance, for example) where repeatedly rebuilding a cold cache represents recurring, avoidable performance degradation.
A comparison table
| Factor | Memcached | Redis |
|---|---|---|
| Core use case | Simple key-value caching | Key-value caching plus richer data structures |
| Persistence across restarts | No | Yes, optional and configurable |
| Additional capabilities beyond caching | Minimal | Pub/sub, atomic operations, more |
| Raw performance for basic object caching | Strong, comparable to Redis | Strong, comparable to Memcached |
| Memory efficiency for pure simple caching | Slightly leaner | Slightly more overhead due to added features |
| Current common recommendation | Still valid, simpler | More commonly recommended default |
Which one for a typical WordPress site
For most WordPress sites today, Redis is the more commonly recommended and more frequently pre-configured option across managed hosting environments, given its persistence advantage and broader headroom for future needs, without meaningfully sacrificing performance for the core object-caching use case compared to Memcached. Memcached remains an entirely valid, slightly leaner choice specifically if your hosting environment already provides it, if your site's needs are genuinely limited to simple object caching with no anticipated need for Redis's additional capabilities, or if minimizing memory footprint is a specific priority on a genuinely resource-constrained server.
How to check if object caching is actually working
Installing a compatible object caching plugin (a persistent object cache drop-in specifically supporting Redis or Memcached, depending on which your hosting provides) and confirming it is actually connected and functioning, rather than assuming based on installation alone, is worth verifying directly. Most such plugins display a connection status directly in the WordPress admin, and a genuine, deeper verification involves comparing page load times or database query counts (visible via a query monitoring plugin) before and after confirming object caching is active, since a meaningful reduction in database query time specifically for logged-in or otherwise uncacheable-at-the-page-level requests confirms the object cache is genuinely functioning rather than merely installed but inactive.
FAQs
Does my hosting provider need to specifically support Redis or Memcached, or can I install either myself?
On shared hosting, this generally requires your specific host to provide Redis or Memcached as an available service, since installing and running either typically requires server-level access beyond what standard shared hosting accounts provide; on a VPS with root access, you can install either directly yourself.
Does object caching help a site with mostly anonymous, non-logged-in visitor traffic?
Less dramatically than for logged-in traffic, since anonymous visitor requests to cacheable pages are typically already served by full-page caching, covered in our full slow WordPress diagnostic guide, which bypasses the database entirely for that request; object caching's benefit is most pronounced for logged-in users, admin operations, and any request that cannot use full-page caching but still benefits from avoiding redundant queries.
Can I switch from Memcached to Redis later without much disruption?
Yes, this is a reasonably straightforward change, generally involving switching your object caching plugin's configuration and drop-in to target Redis instead of Memcached, with WordPress's own object caching abstraction layer designed to accommodate this kind of backend switch without requiring changes to your actual site content or other plugins.
Does WooCommerce benefit more from object caching than a simple blog?
Generally yes, since WooCommerce generates more database-intensive operations (cart, session, and product-related queries) that benefit meaningfully from object caching, particularly for the significant share of WooCommerce traffic (logged-in customers, cart and checkout activity) that cannot be served from full-page caching alone, covered in our WooCommerce checkout guide.
Is there a risk of serving stale data with object caching?
Properly implemented object caching includes cache invalidation logic that clears or updates specific cached entries when the underlying data changes, meaning stale data should not normally be an issue with a correctly functioning setup; a poorly configured or buggy caching implementation could theoretically serve outdated data, worth monitoring for if you notice content appearing not to update as expected after a change.
Does enabling object caching require any code changes to my theme or plugins?
Generally no for standard usage, since object caching operates transparently through WordPress's own caching API that themes and plugins already use for their database interactions; enabling a compatible object cache plugin typically activates this benefit without requiring any code modification on your part.
How much memory should I allocate to Redis or Memcached for a typical WordPress site?
This varies based on site size and traffic, but a modest allocation (several hundred MB to a couple of GB for many typical small-to-mid WordPress sites) is often sufficient; monitoring actual memory usage and eviction rates over time is the most reliable way to determine whether your specific allocation needs adjustment rather than guessing at a fixed number upfront.
Conclusion
Redis and Memcached both solve WordPress's object caching problem effectively, and the practical performance difference between them for core caching purposes is smaller than the feature difference suggests. Redis's persistence capability and broader feature set have made it the more commonly recommended default, particularly valuable for avoiding repeated cold-cache periods after routine restarts, while Memcached remains a perfectly reasonable, simpler choice for sites with more limited, purely key-value caching needs.
Whichever you choose, verifying that object caching is genuinely connected and functioning, rather than assuming based on installation alone, is the step most commonly skipped and most directly determines whether you actually receive the performance benefit.
HostCloud's managed WordPress and VPS hosting includes Redis object caching support configured and ready to use, giving you the persistence and performance benefits without needing to set up the underlying infrastructure yourself. Plans start at ₹99 a month at https://hostcloud.in.
