Should You Use a Persistent Object Cache in WordPress? The Definitive Guide

If you manage a WordPress site, chances are that at some point you've come across a warning in the "Site Health" section that says something like: "You should use a persistent object cache.". This message, although technical, points to a crucial optimization to improve the performance of your website, especially if your site is growing or experiencing a lot of traffic. But what does it really mean and what should you do about it?

In this in-depth article, we'll break down everything you need to know about persistent object caching in WordPress. We'll explore what it is, why it's important, how systems like Redis and Memcached can be your allies, and debunk some common myths. And yes, we'll also tell you when, surprisingly, you might ignore this warning.

Understanding the Warning: "You should use a persistent object cache".

Site Health Warning: WordPress, in its effort to help you maintain a fast and efficient website, includes a diagnostic tool called "Site Health". One of its most common recommendations for sites with a certain level of complexity or traffic is the implementation of a persistent object cache.

When WordPress generates a page, it needs to perform multiple queries to the database. For example, to fetch blog posts, comments, theme configuration options, plugin data, and so on. These queries, although individually fast, can add up to a considerable load on the server, especially if there are many visitors accessing your site simultaneously.

This is where caching comes into play. WordPress has a built-in object caching system (WP_Object_Cache), but by default, this cache is "non-persistent". This means that cached objects are only stored during a single page load. When the page finishes loading, the cache is emptied. For the next visit or the next page load (even by the same user), WordPress has to redo all those database queries.

persistent object cacheInstead, it stores these cached objects in a faster, longer-lasting storage location (such as RAM) so that they can be reused across multiple page loads and by different users. This drastically reduces the number of database queries, easing the load on the server and significantly speeding up your site's response times.

What Exactly is Object Caching in WordPress?

Imagine that your database is a huge library and every time someone visits your site, WordPress has to fetch several specific books (data), read them and then display them. This process is repeated for every visitor and every page that loads.

The object cache works like a quick reading table near the library entrance. When WordPress fetches a "book" (a piece of data or the result of a query) for the first time, it places it on this table. On subsequent requests for that same "book", instead of going all the way to the far shelves of the library (the database), WordPress grabs it directly from the fast reading table.

The "objects" that are cached can be any type of data that WordPress uses frequently:

  • Results of complex database queries (WP_Query).
  • Site options data (wp_options).
  • Transient data.
  • User information.
  • Taxonomy terms.

Having this data available in a fast, persistent cache reduces latency, decreases server CPU usage and ultimately improves the user experience by delivering pages that load faster.

How to Know if You Already Have a Persistent Object Cache Enabled?

Before you get down to business, it's a good idea to check if your site is already using a persistent object cache. Here are some ways to do that:

  1. Review Site Health in WordPress: Go to "Tools" > "Site Health" in your WordPress dashboard. If you don't see the warning about persistent object cache, this is a good sign, though not definite. Look in the "Information" tab under the "Server" section for details about the object cache.
  2. Specific Cache Plugins: If you use plugins like "Redis Object Cache" or "LiteSpeed Cache" (with its object cache module enabled), you probably already have it. These plugins usually have a status page where you can check its operation.
  3. Check with your Hosting Provider: Many managed WordPress hosts (Kinsta, SiteGround, Cloudways, WP Engine, etc.) offer persistent object caching solutions (usually Redis or Memcached) preconfigured or as an easy-to-activate add-on from your control panel. Check your hosting documentation or contact their support.
  4. Use a Diagnostic Plugin: Plugins like "Query Monitor" can show you if database queries are being served from the object cache. Another useful plugin is "WP-FFPC Test" or "Debug Bar" with its extensions, which can show the status of the object cache.

Enabling Persistent Object Caching: Redis vs. Memcached

If you have confirmed that you do not have a persistent object cache and you want to implement it, the two most popular and recommended solutions are Redis and Memcached. Both are in-memory caching systems, which means that they store data in the server's RAM, which is much faster than disk storage.

Activation generally involves two steps:

  1. Ensure that the service (Redis or Memcached) is installed and running on your server. This is usually up to your hosting provider.
  2. Configure WordPress to use this service. This is done through a specific plugin.

Redis (Remote Dictionary Server)

Redis is an open source, in-memory data structure store used as a database, cache and message broker. It is known for its flexibility and broad feature set.

Features and Benefits of Redis:

  • Persistence: Redis can optionally persist data to disk, which means that the cache can survive server restarts (although for object caching, this is not always paramount, the option is there).
  • Rich Data Types: It supports various data types such as strings, hashes, lists, sets, sorted sets, streams, HyperLogLogs and bitmaps. This makes it very versatile.
  • Atomic Operations: Allows complex operations such as atomic increments.
  • Replication and Clustering: It offers built-in replication and different clustering topologies for high availability and scalability.
  • Ideal for: WooCommerce, sites with many connected users, forums (bbPress), social networks (BuddyPress) and any site that needs a robust and flexible cache.

How to activate Redis in WordPress:

  1. Confirm with your hosting that Redis is available and active for your account. They will provide you with connection details (host and port, sometimes a password).
  2. Install a plugin such as Redis Object Cache.
  3. Go to "Settings" > "Redis" (or the plugin location) and enable object caching. You may need to enter the connection details if they are not detected automatically.

Memcached (Memory Cache Daemon)

Memcached is a high-performance, open source, distributed memory object caching system, generic in nature, but intended to be used to accelerate dynamic web applications by relieving database load.

Features and Benefits of Memcached:

  • Simplicity and Speed: Designed to be simple and fast. It is extremely efficient for caching small and frequently accessed objects.
  • Distributed: You can distribute your cache across multiple servers.
  • Multithreaded: It can handle multiple connections and operations concurrently in an efficient manner.
  • Lower CPU consumption: In some benchmarks, Memcached may have a lower CPU impact than Redis for simple get/set operations.
  • Ideal for: Sites that need fast and efficient object caching without the complexity or additional features of Redis. Works great for most blogs and corporate sites.

How to enable Memcached in WordPress:

  1. Check with your hosting for Memcached availability and connection details.
  2. You can use plugins such as W3 Total Cache o LiteSpeed Cache (if your server is LiteSpeed) that have built-in support for Memcached as an object caching backend. There are also dedicated plugins such as Memcached Object Cache (although this may require manual drop-in configuration). object-cache.php).
  3. Configure the chosen plugin to use Memcached, providing the host and port.

Redis vs. Memcached: Which One to Choose?

Both are excellent, but the choice depends on your needs and what your hosting offers:

FeatureRedisMemcached
Data PersistenceYes (optional)No (only in memory)
Supported Data TypesComplex (lists, sets, hashes, etc.)Simple (strings)
ScalabilityGood (clustering)Excellent (distributed by design)
Ease of UseModerateSimple
Common Use CasesCaché, message queues, primary databases, sessions, etc.Object cache
WordPress PluginsRedis Object Cache, LiteSpeed Cache, W3TCW3 Total Cache, LiteSpeed Cache, Memcached (plugin)

In summary:

  • If your hosting offers both and you have a complex site (WooCommerce, BuddyPress, etc.) or you need the advanced features of Redis (such as persistence or specific data types for other functionalities), Redis is usually the preferred choice.
  • If you are looking for a simpler solution, purely for object caching, and your hosting supports it well, Memcached is an excellent and very fast alternative.
  • Check with your hosting provider: They often have a recommendation based on their optimized infrastructure.

The False Friend: Object Cache on Disk and W3 Total Cache

Beware! Not every "object cache" is ideally persistent. Some popular caching plugins, such as W3 Total Cache, offer an "Object Cache" option that uses disk storage.

This is where many users make a mistake. While enabling on-disk object caching with W3 Total Cache (or a similar plugin) could, in theory, make the "Site Health" warning go away, is not the optimal solution and goes against the spirit of what a persistent and fast object cache should be.

Why doesn't it make sense for this purpose?

  1. Speed is Key: The main purpose of a persistent object cache is to store data in an extremely fast medium, such as RAM (which is what Redis and Memcached do). Hard disk (even SSDs) is orders of magnitude slower than RAM. Storing cached objects on disk and then reading them from there introduces I/O (input/output) latency that can, in some cases, be even slower than directly querying a well-optimized database, especially if the disk is already busy.
  2. Not Truly "Persistent" in the Velocity Context: While data on disk is persistent in the sense that it survives restarts, the "persistence" WordPress is looking for with this recommendation refers to having the data ready and accessible *quickly* between page loads. On-disk caching does not meet this speed requirement in the same way that Redis or Memcached does.
  3. Disc wear: Constantly writing and reading small cache files to and from the disk can increase wear, especially on SSDs (although this is less of a concern with modern SSDs, it is still a consideration).
  4. Can Mask Real Problems: By using on-disk object caching, you might think you've "fixed" the problem because the warning goes away, but your site won't be getting the significant performance benefits that Redis or Memcached would provide.

In short, configure the object cache on disk with W3 Total Cache or similar plugins to "fix" the Site Health warning. is, in most cases, a bad practice and will not give you the performance improvement you really need. It's like putting a Band-Aid on a wound that needs stitches: it looks like you're doing something, but you're not effectively addressing the underlying problem.

If you are going to implement a persistent object cache, do it right: use Redis or Memcached.

When Can You Ignore the Warning "You should use a wordpress persistent object cache" without Worries?

Despite all that said, not all WordPress sites imperatively need a persistent object cache like Redis or Memcached. There are scenarios where the complexity and cost (if your hosting charges extra for it) of implementing it may outweigh the benefits.

You may consider ignoring this warning if your site meets several of these conditions:

  • Simple and Static Web Sites: If your site is primarily informational, with few dynamic features, few posts, and content that does not change frequently (e.g., a basic corporate website, a simple portfolio).
  • Low Traffic: If your site receives a very limited number of daily visitors. With low traffic, it is likely that your server can handle database queries without noticeable performance problems.
  • No WooCommerce or Membership Platforms: E-commerce sites (WooCommerce) and sites with many registered users logging in (forums, online courses, membership sites) benefit the most from persistent object caching due to the large amount of dynamic and user-specific queries. If you don't have any of this, the need diminishes.
  • Good Current Overall Performance: If your site already loads fast (i.e., consistently under 2-3 seconds) and Core Web Vitals metrics are good, the additional gain could be marginal. Make sure you are already using a good page cache.
  • Hosting with Limited Resources (and no easy option): If you are on a very basic shared hosting plan that does not offer Redis or Memcached, and upgrading to a higher plan just for this is not economically viable, you can focus on other optimizations (page caching, image optimization, CDN).
  • Few Plugins that Generate Complex Queries: If your site uses a minimum number of plugins, and they are well coded and do not make excessive or inefficient database queries.

Important: Ignoring the warning does not mean that you should do nothing. You should always have a good page cache enabled (via plugins such as WP Rocket, LiteSpeed Cache, W3 Total Cache configured for page caching, or your own server's cache). Page cache is the first line of defense and offers the greatest performance benefits for most sites.

Persistent object caching is a more advanced optimization. If your site is small and working well, you can live without it. However, as your site grows in content, traffic or complexity, this warning will become increasingly relevant.

Conclusion: Power Your WordPress with the Right Object Cache

The caveat "You should use a persistent object cache in WordPress" is not something to take lightly if you're looking for optimal performance, especially on dynamic, high-traffic or e-commerce sites. Implementing a solution like Redis or Memcached can drastically reduce your database load, speed up your page load times and improve your site's scalability.

We have learned that:

  • Persistent object cache stores frequent query results in RAM for ultra-fast access.
  • Redis and Memcached are the leading solutions, each with its own strengths.
  • Configure object cache on disk (as sometimes done with W3 Total Cache) is not a viable alternative to obtain the real performance benefits and is best avoided for this purpose.
  • Very simple sites, with little traffic and no complex functionalities, can function adequately without it, as long as they have a good page cache.

What's next?

  1. Check the "Site Health" section of your WordPress.
  2. Check with your hosting provider about the availability of Redis or Memcached.
  3. If appropriate for your site, enable a persistent object cache and monitor performance improvement.

By taking the time to understand and, if necessary, implement a persistent object cache, you'll be taking an important step in ensuring that your WordPress site runs smoothly, quickly and efficiently, providing the best possible experience for your visitors.

Marcos Arcusin

Marcos Arcusin

Senior WordPress Developer, PHP, Vue.js, Plugin development. My goal is to create effective websites that increase my clients' revenue, using WordPress as a platform.

Related articles