# 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.

Source: https://comparehostingonline.com/guides/what-is-redis-object-caching/

## 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](https://comparehostingonline.com/methodology/)

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 caching | Object caching |
| --- | --- | --- |
| What is stored | The finished HTML page | Database query results and computed data |
| Best for | Anonymous visitors on public pages | Logged-in users, carts, dashboards and dynamic parts |
| Where it lives | Server, plugin or CDN | Redis or Memcached memory |
| Effect | Skips PHP and the database entirely | Makes PHP and database work cheaper |
| Risk | Showing stale pages | Stale 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](https://comparehostingonline.com/guides/what-is-time-to-first-byte/).

## 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.  1
    
    **Check your host supports it**
    
    Look for Redis or Memcached on the plan, or ask support.
    
2.  2
    
    **Enable the service**
    
    On managed hosts it is a switch; on a VPS install and secure Redis yourself.
    
3.  3
    
    **Connect your application**
    
    In WordPress, use a persistent object cache plugin and add the connection details to the configuration.
    
4.  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](https://comparehostingonline.com/guides/how-to-secure-a-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](https://comparehostingonline.com/guides/website-backups-guide/) before you change configuration, and test on [staging](https://comparehostingonline.com/guides/what-is-a-staging-site/) 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

-   [Redis documentation](https://redis.io/docs/latest/)
-   [WordPress developer documentation](https://developer.wordpress.org/advanced-administration/)
-   [web.dev: Time to First Byte](https://web.dev/articles/ttfb)
-   [MDN: HTTP caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)

## 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

[What is TTFB?](https://comparehostingonline.com/guides/what-is-time-to-first-byte/) [Managed WordPress hosting](https://comparehostingonline.com/hosting-types/managed-wordpress/) [What is a CDN?](https://comparehostingonline.com/guides/what-is-a-cdn/)

## More guides

[What is SSH access? What it does and how to use it safely](https://comparehostingonline.com/guides/what-is-ssh-access/) [What "unlimited" hosting really means](https://comparehostingonline.com/guides/what-is-unlimited-hosting/) [What is WHOIS privacy? What it hides and what it does not](https://comparehostingonline.com/guides/what-is-whois-privacy/) [WordPress hosting requirements: what your host needs to run WordPress well](https://comparehostingonline.com/guides/wordpress-hosting-requirements/) [What is DNS? The domain name system explained](https://comparehostingonline.com/guides/what-is-dns/) [How to start a web hosting business: models, costs, legal basics and first customers](https://comparehostingonline.com/guides/how-to-start-a-web-hosting-business/)

MH

**[Muhammad Hamza](https://comparehostingonline.com/team/muhammad-hamza/)** Founder & Editor

Writes and signs off every comparison, and runs the compliance reviews. Has worked on SOC 2 and HIPAA compliance programs for companies.

Our [editorial policy](https://comparehostingonline.com/editorial-policy/) and [testing method](https://comparehostingonline.com/methodology/) are public.
