CompareHostingOnline

Home / Guides / Redis caching explained: what object caching is and whether your site needs it

Guide

Redis caching explained: what object caching is and whether your site needs it

What object caching does, how Redis and Memcached differ from page caching, when it helps WordPress and shops and how to check your host supports it.

By Muhammad Hamza, Founder & EditorUpdated Nov 30, 2026
99%Up to 3.65 days of downtime a year99.9%Up to 8.8 hours a year99.99%Up to 53 minutes a year

Short answer

Object caching stores the results of repeated database queries in memory, usually with Redis or Memcached, so dynamic sites such as WordPress and shops do not rebuild them on every request. It helps most on busy sites and logged-in traffic.

Last verified Nov 28, 2026 · How we test
At a glance
  • What is object caching?A dynamic site builds each page by running code and asking the database many questions: the post, the menu, the settings, the…
  • How does it differ from page caching?The two work together.
  • When does object caching help?Shops and membership sites where many pages are personalised.

What is object caching?

A dynamic site builds each page by running code and asking the database many questions: the post, the menu, the settings, the user. Many of those answers are the same for every visitor and change rarely. Object caching keeps the results in fast memory, so the next request gets them without touching the database. Redis, an in-memory data store, is the common choice, and Memcached is another. WordPress has a built-in object cache API that, with a plugin and a Redis server, stores results persistently between requests.

How does it differ from page caching?

The two work together. Page caching handles the easy traffic, and object caching speeds up the requests that cannot be cached as whole pages, such as checkout and admin screens.

Page cachingObject caching
What is storedThe finished HTML pageDatabase query results and computed data
Best forAnonymous visitors on public pagesLogged-in users, carts, dashboards and dynamic parts
Where it livesServer, plugin or CDNRedis or Memcached memory
EffectSkips PHP and the database entirelyMakes PHP and database work cheaper
RiskShowing stale pagesStale data if invalidation is poor

When does object caching help?

  • Shops and membership sites where many pages are personalised.
  • Sites with many plugins and database queries per page.
  • Busy WordPress admin areas, search and filtering pages.
  • Sites that already have page caching but still show a slow time to first byte on uncached requests; see what TTFB is.

What is Redis and how does it work with your site?

Redis stores data in memory and answers in fractions of a millisecond. The site software sends it a key, such as the cached result of a query, and Redis returns the value or says it has none. A plugin or the framework handles when to store and when to clear. Redis needs memory, so on small plans a cache of a few tens of megabytes is typical, and you should size it to your data. It can also persist data to disk, but for caching you can usually accept losing it on a restart.

How do you set it up?

  1. Check your host supports it

    Look for Redis or Memcached on the plan, or ask support.

  2. Enable the service

    On managed hosts it is a switch; on a VPS install and secure Redis yourself.

  3. Connect your application

    In WordPress, use a persistent object cache plugin and add the connection details to the configuration.

  4. Test and monitor

    Check hit rates, memory use and that logged-in pages still work.

What are the risks and limits?

  • Stale data if keys are not cleared when content changes.
  • Memory use: an undersized cache evicts data constantly and gives little benefit.
  • Security: never expose Redis to the internet; bind it to the local address and use a password; see how to secure a new VPS.
  • Compatibility issues with some plugins.
  • A false sense of speed: it does not fix slow code or heavy pages.

How do you know if it is working?

Look at the cache hit rate, which Redis reports, and at the number of database queries per page before and after, using a query monitor plugin or logs. Compare the response time of an uncached request, such as a logged-in page, before and after. If the hit rate is low or memory keeps filling, adjust the size and the expiry. Keep a backup before you change configuration, and test on staging first.

What are the common mistakes?

  • Installing a Redis plugin without a Redis server.
  • Leaving Redis open to the internet.
  • Using object caching to hide a slow plugin instead of fixing it.
  • Setting the memory too small, or never expiring keys.
  • Assuming it replaces page caching.

A worked example: a shop before and after object caching

A WooCommerce shop has page caching for catalogue pages, but each logged-in customer page and each cart request still runs 120 database queries and takes about 900 milliseconds on the server. The owner adds Redis with a persistent object cache plugin on their VPS. After a day of warming, the hit rate settles around 90 percent, queries per request fall to about 40 and the same cart request takes around 350 milliseconds. CPU use at peak drops, which lets the owner stay on the current plan for another year.

The numbers will differ on every site, but the pattern is typical: the biggest gain comes where requests cannot be served from a page cache. The owner then sets a memory limit for Redis and an eviction policy, so the cache cannot grow without bound.

What settings matter in Redis for caching?

  • Maximum memory: set a limit sized to your working data.
  • Eviction policy: choose one that removes the least recently used keys when memory is full.
  • Key expiry: give cached items a sensible lifetime so stale data does not linger.
  • Authentication and network binding: require a password and listen only on the local address.
  • Persistence: usually unnecessary for a cache; restart means a short warm-up.

Sources and further reading

Common questions

Do I need Redis for my website?

Only if the site is dynamic and busy, such as a shop, a membership site or a WordPress site with many plugins. Small cached sites do not need it, and the effort and memory may not be worth it.

Is Redis the same as page caching?

No. Page caching stores finished pages for anonymous visitors. Redis stores database query results and other computed data, so uncached and logged-in requests are cheaper. The two work together.

Does my host offer Redis?

Many managed WordPress hosts and VPS plans do, sometimes as an add-on. Shared plans often do not. Check the plan details or ask support before you buy.

Is Redis safe to run on a VPS?

Yes, if you bind it to the local address, set a password, keep it updated and firewall it. Never expose Redis to the public internet, because it is commonly targeted when left open.

What is the difference between Redis and Memcached?

Both are in-memory caches. Redis supports more data types and optional persistence, while Memcached is simpler. For WordPress, either works with the right plugin; use whichever your host supports and documents.

Related

More guides

Esc

Use the arrow keys, then Enter.