Skip to content
Arrow keys to move, Enter to open, Esc to closeAll results
Performance · Guides

Redis vs Memcached: Object Caching for WordPress Explained

Object caching stores database query results in memory. Here is how it differs from page caching, how Redis and Memcached compare, and how to set it up and check it works.

Written by
WPresident Editorial
Updated
November 2026
Topic
Performance

WordPress asks the database many questions on every request: options, posts, terms, user data. An object cache keeps the answers in fast memory so the next request does not have to ask again. It is one of the most effective speed-ups for dynamic sites, such as WooCommerce stores and membership sites, where full-page caching cannot help much.

Page cache vs object cache

Page cache Object cache
Stores The finished HTML of a page Results of database queries and computed data
Helps most with Public pages that are the same for everyone Logged-in users, carts, search and admin screens
Typical tools Host cache, caching plugins Redis or Memcached with a WordPress drop-in

They work together. Use a page cache for public pages and an object cache for everything dynamic.

Redis vs Memcached

Redis Memcached
Data types Strings plus lists, sets, hashes and more Simple key-value strings
Persistence Can save data to disk so the cache survives restarts In memory only
WordPress support Widely supported by hosts and plugins Supported, somewhat less common on managed hosts
Best for Most WordPress sites, especially stores Very simple, high-throughput caching
The Redis website
Redis, an in-memory data store used for WordPress object caching: redis.io.

For most WordPress sites, Redis is the default choice because host and plugin support is broad and it handles the caching patterns WordPress uses well. Memcached remains a solid option if your host offers it and you prefer its simplicity.

How to set it up

  1. Check that your host offers it. Many managed hosts include Redis or provide it as an add-on. On your own server, install and secure Redis or Memcached.
  2. Install an object cache drop-in. A plugin or the host’s tool places an object-cache.php file in wp-content that connects WordPress to the cache.
  3. Add connection settings to wp-config.php if required, such as host, port and a unique key prefix so multiple sites do not mix data.
  4. Enable it and flush the cache.

Check that it works

  • Open Site Health in WordPress. It reports whether a persistent object cache is in use.
  • Use Query Monitor to compare database query counts before and after.
  • Use the plugin’s status screen to see hit and miss counts.

Pitfalls to avoid

  • Stale data. If a plugin does not invalidate cached data correctly, you may see old content. Flush the cache after big changes.
  • Shared prefixes. Two sites using the same prefix can read each other’s data. Always set a unique prefix.
  • Memory limits. If the cache is too small, it evicts items constantly and helps little.
  • Do not expect miracles on static pages. Object caching helps most on dynamic requests.

Final thoughts

If your site is a store, a membership site or has many logged-in users, object caching is among the highest-value changes you can make. Pick Redis unless your host steers you elsewhere, set a unique prefix, and verify it with Query Monitor.

Frequently asked questions

Do I need both a page cache and an object cache?

For dynamic sites, yes. They solve different problems. Blogs with mostly static pages may see little benefit from an object cache.

Can I use Redis on shared hosting?

Only if the host provides it. Many shared plans do not. Check with your provider before buying a plugin that requires it.

W
Written byWPresident EditorialThe WPresident editorial team. We test products on real sites, score them with one public method and write up what holds up.

Keep reading

Performance

The Best WordPress Caching Plugins in 2026

Where the page cache runs, which host you are on and how far you push CSS and JavaScript decide the right caching plugin. Eight options with failure modes and rollbacks.

Read more
WPresident EditorialNovember 2026

Get the Monthly Launch Report

One email a month: the best of last month's articles, new reviews and what changed in WordPress, without the noise.

No spam. Unsubscribe in one click.

Signed and sealed,
The WPresident

Press Esc to close. Use the arrow keys to move through results.