French flag Hosted and supported in France A human reply within 12 hours 06 65 13 24 36
← All articles Hosting & performance16 min read

Redis WordPress: when is an object cache really useful?

Redis does not speed up every WordPress site. It helps when non-cacheable pages repeat the same queries. Here is how to tell whether that is your case, and how to check it by measurement.

“Turn Redis on and your site will be faster.” The promise comes round often, and it is sometimes true. But a well-cached brochure site will often show no difference at all to its visitors, while a shop with many signed-in customers really can benefit. It all depends on where your site spends its time.

Servers and a graph illustrating the Redis object cache on WordPress
Several caches, several roles: Redis is only one of them.

The cache layers of a WordPress site

When a WordPress page is requested, several steps follow one another: the browser checks whether it already has the files, the request may cross a CDN, the server looks for a ready-made copy of the page and, failing that, PHP runs WordPress, which queries the database. At each step, a cache layer can avoid redoing work already done.

Redis only comes into play when WordPress actually runs. A page served by the page cache never calls on it.

That position explains almost everything. If 95% of your page views are served by the page cache, Redis concerns only the remaining 5%. If, on the contrary, most of your pages are personalised, Redis comes into play on nearly every visit.

Compared: page cache, Redis, OPcache and CDN

EVERY LAYER HAS ITS FUNCTION

What each technology caches

TechnologyWhat it cachesUseful forMain limit
Page cachingThe page's final HTMLPublic pages identical for every anonymous visitorPoorly suited to personalised pages (basket, account, signed-in users)
Redis (object cache)Objects and query results reused by WordPressDynamic sites, WooCommerce, members' areas, the adminNeeds configuration and monitoring; no effect on pages already served by the page cache
OPcacheCompiled PHP code (bytecode) in shared memoryAlmost every PHP siteDoes not replace a data cache: the database queries still run
CDNResources (images, CSS, JS, sometimes pages) copied onto relay serversAn audience far from the server, heavy media, traffic peaksDoes not speed up the origin server's work for dynamic pages
Browser cacheFiles the visitor has already downloadedRepeat visits, moving between pagesNo effect on the first visit

OPcache is the most discreet and often the most rewarding: built into PHP, it avoids recompiling the site's files on every request. It is on by default on most recent hosting, but it is worth checking. The page cache does most of the work for a public site. Redis comes next, for whatever stays dynamic. The CDN, for its part, answers another question, that of distance, dealt with in the guide CDN: is it really useful for a site hosted in France?

The WordPress object cache explained simply

While it builds a page, WordPress asks for a great deal of information: the site's settings, the menu, a product's metadata, a category's terms, the signed-in user's profile. To avoid asking the database the same question twice in the same page, it keeps the answers in an internal object cache .

By default that cache lives only for the length of one request: on the next page everything is forgotten and the same questions go back to the database. A persistent object cache plugin (an object-cache.php file placed in wp-content, supplied by the plugin) redirects that cache to an external service such as Redis. The answers then survive from one request to the next, and from one visitor to the next.

Without a persistent cache

Every page starts from scratch

The settings, menus and metadata are read from the database every time a page is generated. On a small site that is quick; on a large, busy database, those repeated queries add up.

With Redis

The frequent answers stay in memory

The first page pays the cost of the query, the following ones reuse the result as long as it has not been changed or evicted from memory.

Since version 6.1, the Tools > Site Health page can recommend a persistent object cache. To do so, WordPress compares several of the site's indicators (the number and size of autoloaded options, the number of posts, comments, terms and users) against thresholds. It is a good sign, not proof: the recommendation does not measure the time actually lost on your pages.

When Redis really is useful

WooCommerce: basket, checkout and customer account

These pages are specific to each visitor and cannot be served from a full page cache. Every addition to the basket, shipping calculation or look at the account runs WordPress and queries the database. A persistent object cache reduces the repeated queries on those pages, which makes it one of the levers mentioned in the guide on WooCommerce slow. A large catalogue with many attributes generally benefits more than a small shop with a few products.

Members' areas, training sites, intranets

As soon as a user is signed in, most page caches let them through so as to show them their own version. A membership site, a course platform or an intranet therefore generates nearly all its pages on demand. That is the profile where the object cache has the most purchase.

A heavy admin and an editorial team

The admin is never page-cached. An editorial team of several people working in a loaded back office (a page builder, many plugins, a large volume of content) can feel a clear gain, even if the public site is already fast.

Multisite

A multisite network shares one database across several sites, with common data read constantly. A persistent object cache is common there, provided each site's keys are properly isolated.

Sites that repeat costly queries

Faceted search, filtered archive pages, widgets that work out rankings: when profiling shows the same slow queries from one page to the next, the object cache is a direct answer. If the query is slow because it is badly written, it is better to fix it: the cache only hides the cost until the next expiry.

When Redis brings little, or nothing

Knowing when not to add it matters just as much. Every extra component is a service to configure, monitor and update.

Little gain

A small, well-cached brochure site

Visitors receive ready-made HTML. Redis only runs when the cache is regenerated, and for the admin.

Little gain

Slowness on the browser side

Heavy images, third-party scripts, fonts: the server answers quickly, it is the rendering that drags. The guide on Core Web Vitals on WordPress covers those causes.

Little gain

One particular plugin is at fault

A plugin that calls a remote API on every page stays slow with or without Redis. It has to be identified, as the guide on plugins that slow WordPress down.

A risk

Very limited memory resources

On small hosting, reserving memory for Redis can take it away from PHP or from the database. The gain then has to be demonstrated, not assumed.

Redis does not make a site fast. It avoids redoing work already done. If that work is not repeated, or if it is not the cause of the slowness, there is nothing to avoid.

Before any extra layer, check the basics: a recent, supported PHP version (see the guide on changing PHP version on WordPress), OPcache active, a working page cache for anonymous visitors. The guide on WordPress server response time too high sets out the order of those checks.

Free Host by French tool

Is Redis useful for my WordPress site?

Seven questions to tell whether a persistent object cache stands a chance of improving your site. The result is a pointer: only a before-and-after measurement really settles it.

An indicative pointer worked out in your browser. It knows neither your server configuration nor the real time your queries take.

Unsure about adding Redis or a CDN?

Ask for a measurement of my site

Memory, persistence and invalidation: what Redis asks of you day to day

Memory and the eviction policy

Redis stores everything in RAM. The maxmemory directive sets the maximum amount it may use; with no limit, it goes on growing. When the limit is reached, Redis applies the eviction policy chosen. For a cache, the usual choice is a policy that evicts the least recently used keys, such as allkeys-lru. With the noevictionpolicy, Redis refuses instead to store new data once memory is full, which produces write errors on the site side. The default value depends on the version and the configuration installed: it is to be checked, not assumed.

Persistence

Redis can write its data to disk so as to find it again after a restart. For a WordPress object cache that is generally not necessary: the database remains the source of truth and the cache rebuilds itself as visits come in. Turning persistence off avoids pointless disk writes; keeping it speeds up recovery after a restart. It is an operational choice, to be made knowingly.

Invalidation

The risk with a cache is serving stale data. WordPress invalidates the objects it changes through its own standard functions itself. The problems come from code that writes straight to the database without going through those functions (imports, synchronisation scripts, manual SQL queries): the cache keeps the old value. After that kind of operation, the object cache needs purging. On a shop, test the stock, the prices and the promotions in particular.

Isolation between sites

If several sites share one Redis instance, each has to use a distinct key prefix (or a distinct Redis database). Without that, two sites can read each other's data, and a purge on one empties the cache of them all.

Measuring before and after: the only way to conclude

  1. 01

    Pick 3 to 5 non-cacheable pages

    The customer account, a basket with a product in it, internal search, a loaded admin page. The home page served from the cache will tell you nothing.

  2. 02

    Take the baseline

    Server-side generation time and the number of database queries (Query Monitor on a copy), with several readings at comparable times.

  3. 03

    Turn Redis on, on the copy

    With a memory limit, a suitable eviction policy and a key prefix. Check that the plugin reports an active connection.

  4. 04

    Measure under the same conditions

    The same pages, the same user, several passes to let the cache fill. Compare the time and the number of queries.

  5. 05

    Decide and monitor

    A clear gain: move to production and watch memory used, the cache hit rate and the errors. No gain: take Redis out, your bottleneck is elsewhere.

Do not trust a single measurement: the first pass after switching it on is often slower, the cache being empty. Do not put a figure on the gain in advance either: no percentage applies to every site, and the only data that counts is that of your own pages.

The mistakes to avoid

Mistake 01

Stacking caches without knowing which one is working

Two object cache plugins, a page cache in the theme and another on the server: diagnosis becomes impossible and purges inconsistent.

Mistake 02

Turning Redis on to fix front-end slowness

The server was not the problem. Measure the initial response time before touching the server.

Mistake 03

Leaving Redis with no memory limit

The cache ends up competing with PHP and the database, or refusing writes depending on the policy configured.

Mistake 04

Sharing an instance with no prefix

Data mixed between sites, purges that empty everything: each site needs its own space.

Mistake 05

Forgetting the purge after an import

A direct database import leaves old values in the cache: the prices or stock shown no longer match.

Mistake 06

Concluding without measuring

An impression of speed after switching it on is not worth a comparison on the same pages.

On theHost by French infrastructure, NVMe storage, the RAM cache and the PHP configuration form the common foundation; a persistent object cache is then considered site by site, when the measurements show repeated queries on dynamic pages. For shops,managed WooCommerce hosting builds that analysis into the sizing.

FREQUENTLY ASKED QUESTIONS

Frequently asked questions about Redis and the object cache

Does Redis speed up every WordPress site?

No. It speeds up the pages WordPress generates at every visit and that repeat the same queries. A site where almost every page is served by a page cache generally gains only a limited benefit, mostly in the admin.

What is the difference between Redis and a page cache?

The page cache keeps the final HTML and avoids running WordPress. Redis keeps pieces of data used while WordPress runs. The two complement each other: the first serves anonymous visitors, the second helps when the page has to be generated anyway.

Are OPcache and Redis the same thing?

No. OPcache holds the compiled PHP code in memory, which avoids re-reading and recompiling the files on every request. Redis holds data that came from the database. OPcache is useful to almost every PHP site; Redis only to some.

Can Redis show stale data?

Yes, if data is changed without going through WordPress's functions, for instance during a direct database import. Purging the object cache after those operations, and testing the stock and the prices, avoids the problem.

What does the Site Health recommendation mean?

Since WordPress 6.1, Site Health can suggest a persistent object cache when certain volumes (autoloaded options, posts, users, terms) go past given thresholds. It is a useful sign, but it does not measure the time actually saved on your pages.

Does Redis use a lot of memory?

It uses the memory you give it. A limit (maxmemory) and a suitable eviction policy stop it competing with PHP and the database. The right size depends on the volume actually cached, which you measure after a few days.

IN SHORT

The right cache is the one that answers your own slowness.

Redis is an excellent tool for dynamic sites and pointless complexity for many brochure sites. Measure the non-cacheable pages, then decide.

Have my site measured

Summary with an AI

Choose your assistant: the request is prefilled where that is possible, and always copied, ready to paste if need be.

ChatGPTSummarise the article PerplexitySummarise the article ClaudeSummarise the article CopilotSummarise the article MistralSummarise the article GeminiSummarise the article
THEY TRUSTED US

Client references

See all case studies
Montreuil-sur-Mer logo Data Labcenter logo Sofradom logo 70 Football logo Afrique sur 7 logo CyberJay logo Élisa Reddet logo Foire du Trône logo Goodyvest logo Kincy logo Lhotellier logo Audrey Mégelé du Bourg logo MYF logo
Sine Qua Non logo Make It Happen logo Sonance Audition logo ACME logo Beluvia Bar Store logo Desaltera logo Fête des Loges logo GD Menuiseries logo 3G Immo logo Lavish logo Maison du Feu logo Mieux Fiscal logo MYF Tea logo
Go deeper

Articles to go further on the Redis WordPress guide.

See all articles
What they say about working with us

Google reviews about the support we provide for the Is redis object cache useful for wordpress. page

Google logo 4,8/5 243 verifiable Google reviews Read the reviews
★★★★★
“A WordPress pro. His skills, his grasp of what we needed and his clear explanations made the whole project run smoothly.”
Nicolas Le Couteur Review published on Google
★★★★★
“Always available to answer questions, very professional. Every technical problem we ran into was resolved.”
Cuong Doan Review published on Google
★★★★★
“A professional who listens to his clients. Thank you for the commitment and the time spent on our project.”
Sakina Sedkaoui Review published on Google
★★★★★
“Someone you can trust, who understood my needs straight away and put an effective strategy in place.”
Vincent Loustalot Review published on Google
★★★★★
“Very attentive, motivated and able to propose tailored SEO strategies. The quality of the work is remarkable.”
Marine Mongodin Review published on Google
★★★★★
“Quality work, delivered on time. Maxime is responsive, suggests relevant adjustments and delivers careful work.”
Olivier Opron Review published on Google
★★★★★
“Spot on, perfect work, nothing to fault!”
Robin Gomez Review published on Google
★★★★★
“Maxime adapts very quickly, even to the trickiest technical situations. The result is always there.”
Philippe Bertieaux Review published on Google
★★★★★
“Impeccable work from start to finish, highly responsive and flawless quality.”
Alex Houillon Review published on Google
★★★★★
“The site is fast and visually very good. Maxime also helped us build our SEO strategy.”
Lois Guillermond Review published on Google
★★★★★
“An exceptional developer.”
Honoré Comlan Koumondli Review published on Google
★★★★★
“Maxime showed great professionalism and great creativity in helping us build our charity’s website.”
Julien-Benoit Birman Review published on Google
★★★★★
“A solid understanding of search optimisation when building a WordPress site.”
JM Review published on Google
★★★★★
“Maxime is responsive, a good teacher, and anticipates what is needed to get the strategy right.”
Romain Bergé Review published on Google
Your site deserves better

Let’s talk about your hosting

Tell us about your project. You get a clear recommendation, no jargon and no commitment.

Get my recommendation Reply within 12 hours • Migration handled • Free quote Active infrastructure
Google logo 243 Google reviewsVerifiable public reviews
Find my plan