You should use a persistent object cache - WordPress Health Check - Wordify (2024)

  • ByNick Bryant

You should use a persistent object cache - WordPress Health Check - Wordify (1)

Table of Contents

You should use a persistent object cache - WordPress Health Check - Wordify (2)

“You should use a persistent object cache” is the result of a new health check introduced in WordPress 6.1. This article will explain why you’re seeing this recommendation and what you can do to fix it, if you need to at all.

You should use a persistent object cache - WordPress Health Check - Wordify (3)

How does WordPress Health Check know if I need a Persistent Object Cache?

As of WordPress 6.1, a new specific Cache Health Check has been added. There are two health checks, a Full Page cache check and also a Persistent Object Cache check.

Basically, the object cache uses a set of “tests” to decide if an object cache would be beneficial.

Here are the variables that are used:

 * Override the whole $thresholds array, or any specific indexes as required.
*/
add_filter( 'site_status_persistent_object_cache_thresholds', function( $thresholds ) {
$thresholds = array(
'alloptions_count' => 600,
'alloptions_bytes' => 200000,
'comments_count' => 2000,
'options_count' => 2000,
'posts_count' => 2000,
'terms_count' => 2000,
'users_count' => 2000,
);
return $thresholds;
} );

We’re not going to go into each variable here, but we don’t necessarily agree this is the only way you would test if a site would benefit from an object cache. As mentioned before, if a site doesn’t create dynamic content on a per-user basis it’s unlikely an object cache is the source of its performance issues. A page cache in this scenario would be much more beneficial. That said, there are certainly lots of cases where a site can benefit from Object Caching.

What is a Persistent Object Cache?

Persistent Object Caches are specialized servers such as Redis or Memcached that provide an in-memory data structure store which is perfect for certain kinds of caching.

In the WordPress world, the most common use for object caching is as a database or MySQL query cache. So for example, where a particular section of code will have to go and look at the WP_Options table many times, the results of this query can be cached in memory in your Object Cache. The next time the query results are needed, you hit up your object cache and get them almost instantly. While database servers employ their own caches, they very often still need to refer to disk and calculate the results which may take longer.

Like with any caches there is a trade-off for increased performance but older stale data. If you set your cache to not live for very long, then more queries are thrown at the database and the benefit of the cache is somewhat negated.

A page cache removes the requirement for any type of data lookup whatsoever in terms of queries, as the page has already been created and cached. The next time someone requests the page, the web server (or reverse proxy caching server) serves the page up itself without invoking any PHP, Mysql etc. In this scenario, an object cache wouldn’t help.

Where object caches really shine, is where Page caches can’t be used. For example, if you’re running a woocommerce store and we have a logged-in user adding items to their cart and accessing account information, a page cache can’t help us as this content is unique to the user. However, an Object cache could help us with queries that are accessed more than once.

How do I add a Persistent Object Cache to WordPress?

To add a persistent object cache you will need to make sure your site has access to a Redis or Memcached server.

Once that’s the case you can use a plugin on WordPress to enable the use of the object cache. Here are some popular options:

Is it time for a better WordPress host?

View Plans

You might also like..

Rapid Object Backups – Faster WordPress Backups

May 27, 2024

5 Obvious Reasons You Should Switch WordPress Hosting Providers

February 16, 2024

Wordify Introduces WP-CLI Terminal for Ultimate WordPress Control

January 3, 2024

Are you wasting money on your current hosting provider?

get a free audit

Related Posts

You should use a persistent object cache - WordPress Health Check - Wordify (5)

5 Obvious Reasons You Should Switch WordPress Hosting Providers

Are you feeling frustrated with your current WordPress hosting provider? Perhaps you’re experiencing sluggish performance, unreliable uptime, or lackluster customer support. Whatever the reason, it

Read More »

Stef Faller No Comments

You should use a persistent object cache - WordPress Health Check - Wordify (7)

Optimizing Cost Efficiency: A Critical Analysis of Tiered Pricing Models for Small Agencies in Managed WordPress Hosting

WordPress has become the go-to platform for building websites, and the demand for reliable hosting services is on the rise. As a freelancer,

Read More »

Stef Faller No Comments

You should use a persistent object cache - WordPress Health Check - Wordify (2024)

FAQs

How to fix you should use a persistent object cache? ›

To add a persistent object cache you will need to make sure your site has access to a Redis or Memcached server. Once that's the case you can use a plugin on WordPress to enable the use of the object cache. Here are some popular options: Redis Object Cache.

What is the best persistent object cache for WordPress? ›

When it comes to reliable persistent Object Cache in WordPress, Redis or Memcached comes on top.

Should I enable object cache in WordPress? ›

An unresponsive website will result in a poor user experience and turn visitors away, causing financial loss. To prevent this issue, make sure to have object caching enabled on your WordPress site, as it can optimize your server and boost the website's responsiveness.

How do I resolve cache issues in WordPress? ›

However, if you experience problems and need to clear your cache, it's easy to do so. Just head to your WordPress dashboard and navigate to WP Engine in the sidebar. Then click on Purge All Caches under the General settings. It's that simple!

How do I disable object cache? ›

Disable Object Cache
  1. Login to the User Portal.
  2. Select the environment name you'd like to enable object caching on.
  3. Click Caching.
  4. Locate Object Caching and toggle to Off.
May 16, 2024

How do you reset the object cache? ›

Flush the object cache or the disk-based cache

Under Site Collection Administration, click Site collection object cache. In the Object Cache Reset section, do one or more of the following: To force the current server to flush its object cache, select the Object Cache Flush check box.

Which cache is best for WordPress? ›

  1. WP Rocket. 🥇Best Cache Plugin Overall. ...
  2. WP-Optimize. 🥈Best Free Caching Plugin. ...
  3. W3 Total Cache. 🥉Best Caching Plugin For Advanced Users. ...
  4. LiteSpeed Cache. ...
  5. WP Super Cache. ...
  6. WP Fastest Cache. ...
  7. Hummingbird. ...
  8. Autoptimize.

How often should I clear my WordPress cache? ›

Any time you update your theme or plugin on WordPress, it's recommended to clear your WordPress cache. Without a clear WordPress cache, the changes made in the update might not go into effect.

Is it safe to clear cache in WordPress? ›

Is it safe to delete cache in the diretory of wp-content/cache/autoptimize? yes, it is safe but make sure to after that clear any page cache you might have.

How do you clear object cache in WordPress? ›

The object cache can be flushed with the WP-CLI command wp cache flush . WP-CLI commands must be run with VIP-CLI. Use caution when flushing the object cache on a production environment. The performance of a site's origin database server is protected by the object cache layer.

How long does WordPress cache last? ›

By default cache-control headers should be 10 minutes for posts and pages which you can see from the WP Engine menu in the WordPress dashboard. To purge Edge Full Page Cache, use the Clear Network Caches option on the Cache page of the User Portal. Learn more here.

How do I clear my cache automatically in WordPress? ›

Plugin Settings
  1. Navigate to WordPress admin dashboard -> Settings -> Autoptimize Cache Settings.
  2. Select from one of the available Maximum cache file size options from the select menu and press the Save Changes button.
  3. Please note: You obviously must have Autoptimize plugin installed for this plugin to work.
Aug 22, 2021

How do I clear my WordPress cache without plugins? ›

Clearing cache without a WordPress plugin is possible and can be done manually. To do so, you need to delete the content of your website's wp-content/cache folder using an FTP client such as FileZilla or by accessing your server directly.

How do I stop WordPress from caching? ›

How Do You Disable Caching in WordPress?
  1. Find and edit the wp-config. php file for your site.
  2. Locate this section in wp-config. php file: define('WP_CACHE',true);
  3. Change value of true to false.
  4. Save your changes.
Jul 13, 2022

How do I check if cache is enabled in WordPress? ›

Go to Settings -> WP Super Cache. Look for the “Cache Tester” form on the easy settings page. Click “Test Cache” and the plugin will request the front page of the site twice, comparing a timestamp on each to make sure they match.

How to install persistent object cache? ›

If you're good to go, this plugin is super simple to install—just activate the plugin, go to Settings > Redis and click “Enable Object Cache.” If you run into any problems, again, you'll need to check with your web host whether the server your site is hosted on is set up for Redis.

How do you resolve caching problems? ›

To fix browser cache issues, you can start by clearing your browser cache and cookies. This will remove any outdated or corrupted files that may be causing problems. If the issues persist, you can try disabling browser extensions or plugins, or even resetting your browser to its default settings.

What is persistent caching? ›

Persistent cache is the cache image stored on disk. With persistent cache, the RadiantOne service can offer a guaranteed level of performance because the underlying data source(s) do not need to be queried and once the server starts, the cache is ready without having to “prime” with an initial set of queries.

How do you fix cache poisoning? ›

As for cache poisoning, a very DNS-specific attack, the most common fix is to update the DNS software so that queries are sent from more random source ports. This effectively lessens the chance that an attacker will successfully guess all five (5) fields in the answer.

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 5403

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.