Redis object caching stores the results of WordPress database queries in memory, so repeat requests skip the database and your pages build faster. This guide explains how it works, how it differs from page caching, the cache-aside pattern behind it, and what to check before you turn it on.
Imagine you have a big bookshelf full of books. Sometimes, when you want to read a book, you have to search through all the shelves to find it. That can take a lot of time!
Now, think of Redis object caching like having a small table next to your reading chair. Instead of searching the whole bookshelf every time you want a book, you put your favorite books on the table where they’re easy to grab. So, when you want to read one of them, you can quickly pick it up from the table instead of searching the whole shelf.
In technical terms, Redis object caching is like having a super-fast memory for your website. Instead of fetching information from a slow database every time someone visits your site, Redis stores that information in its memory. So, when someone asks for the same info again, it’s already there, ready to go, making your website load much faster.
We use Redis object caching to speed up websites and make them more efficient. It helps handle lots of visitors without slowing down the site, which is super important for keeping people happy and engaged.
What Is Server-Side Page Caching
Before we dive into object caching, let’s understand how your website serves a page without any cache.
- When someone visits your WordPress site, their web browser talks to Nginx (the server).
- Nginx passes the request to PHP-FPM (a program that runs PHP code).
- PHP-FPM checks with the database (like MariaDB or MySQL) to get the page content.
- PHP-FPM processes everything and creates an HTML page.
- This HTML page is sent back to Nginx.
- Finally, Nginx sends this HTML page to the visitor’s web browser.
Why You Should Always Opt for Server-Side Caching
When you use server-side page caching, Nginx keeps a copy of the HTML page that PHP-FPM produced.
So, when another person visits the same WordPress page, your site doesn’t need to do the same PHP and database work again. Nginx just serves the cached page directly.
This makes your server respond much faster after the first load. It also reduces the work for PHP-FPM and MariaDB/MySQL, lowers your server’s CPU usage and frees up PHP workers for requests that can’t be cached.
With server-side caching, your server can handle more visitors without needing a bigger setup. This means you can stick with a more affordable server without needing to upgrade.

What Is Redis? With Example
Redis, which stands for Remote Dictionary Server, is a tool that stores data in memory. It’s like having a super-fast digital organizer that helps keep track of different types of information, such as words, lists, numbers, and even geographical locations.
Think of it as a helpful assistant that works alongside databases like MySQL or MariaDB to speed up applications. By storing frequently accessed data close at hand, Redis helps optimize the performance of applications, making them run smoother and faster.
Let’s say you have a website where users can see popular articles. Instead of calculating which articles are popular every time someone visits the page, you can use Redis caching. You calculate the popular articles once, store them in Redis, and then whenever someone visits the page, you quickly fetch the list from Redis instead of recalculating it every time.
This makes your website faster and saves a lot of time and effort!
Redis Object Caching for WordPress
Object caching saves the results of database queries that users ask for. Then, when someone asks for the same thing later, it can give them the answer much faster without asking the database again.
In WordPress, there’s a built-in Object Cache using the WP_Object_Cache class. But there’s a catch: by default, this caching isn’t persistent. The saved answers only stick around until the page finishes loading. This isn’t very efficient unless you add a persistent caching system like Redis Object Cache.
Understanding Redis Integration with WordPress Cache Plugins
Unlike regular WordPress cache plugins that focus on speeding up how quickly your website’s pages load by saving static versions of pages, Redis works as a server-side cache. This means it stores data directly on the server to make fetching information faster.
Let’s imagine you have a blog where you post articles about travel destinations. You also have an online shop where you sell travel gear and accessories. To make your site faster, you decide to use a cache plugin.
Most cache plugins focus on storing static versions of your blog posts and shop pages, so they load quickly for visitors. But what about other parts of your site, like the checkout process or interactive features? This dynamic content isn’t page-cached, and that’s where object caching helps.

With dozens of plugins active on your site, including ones for social media sharing, SEO optimization, and more, your WordPress Admin area might feel sluggish because it’s not caching this dynamic content.
Unlocking WordPress Speed: The Role of Redis Explained
Having a slow WordPress website is frustrating for both visitors and site owners. But you can make your site faster and improve the user experience by using a caching system like Redis.
When Redis is set up on your WordPress site, it speeds up how quickly visitors can access your content. Normally, when someone asks for information on a WordPress site, the system has to search through a database, which takes time.

Redis keeps important information in its memory so it can be quickly accessed when needed. This means data can be retrieved much faster, making your site perform better and reducing the time it takes for pages to load.
Using Redis for Query Caching in WordPress
Have you ever faced the frustration of slow database queries? Query caching could be your saving grace, speeding up these queries using various caching methods while keeping costs manageable!
Imagine you’ve developed an e-commerce app that’s experiencing rapid growth. Your product catalog is extensive, and you have millions of customers. That’s great for business, but it’s straining your technology. Despite efforts to optimize database queries to your primary database, they’re slowing down. Even with some performance tweaks, it’s not meeting your customers’ expectations.
Redis is a special kind of storage system that mainly handles caching. It helps to ease the burden on your main database by speeding up how quickly you can get information from it.
In e-commerce apps, there’s one type of request that comes up a lot: searching for products. To make product searches faster, you can use Redis in a couple of ways:
- Cache prefetching: You can load up Redis with all the product details beforehand. Then, when someone wants to search for a product, the app can check Redis first instead of going straight to the main database.
- Cache-aside pattern: Instead of loading up Redis with everything in advance, you fill it up as needed. When someone wants to search for a product, the app puts that information into Redis so it’s there for the next person who wants to search for the same thing.
Cache-Aside Method with Redis Object Caching (Cache Miss)

Let’s break this diagram into some easy points:
- The app asks for some data.
- The backend looks in Redis to see if it already has that data.
- If Redis doesn’t have the data (a “cache miss”), the backend gets it from the main database.
- Once the data is fetched from the database, it’s saved in Redis.
- Finally, the data is sent back to the app.
Cache-Aside Method with Redis Object Caching (Cache Hit)
Now, let’s look at what happens when there’s a “cache hit.” It’s the same flow, just shorter.
In a “cache hit”:
- The app asks for data.
- The backend checks if the data is in Redis.
- If the data is found (a “cache hit”), it’s sent back to the app right away.
The cache-aside pattern is handy when you:
- Need to fetch data a lot: Like in e-commerce, where you’re always checking product info.
- Want to save memory: Instead of loading up Redis with everything, it only saves what’s needed when it’s needed.
- Care about costs: The less you store in the cache, the less memory your server needs.

Precautions to Take Before Implementing Redis Cache in WordPress
Before you turn on the Redis cache for your WordPress site, it’s crucial to take some precautions. Skipping these steps can cause stale data, conflicts between sites or downtime.
Go for Staging Site
Developers recommend testing any changes to your website in a staging environment first. This way, even if something goes wrong, your actual site stays safe. It’s like a practice run where you can learn from any mistakes.
Once you’re confident everything works smoothly, you can “push” those changes to your live site. This means the changes aren’t made to the live site until you decide to do so.
Your staging environment is basically a copy of your real website. It’s not accessible to the public, and search engines can’t see or index it because it’s protected by a password.

Configuring WP Config File to Avoid Conflicts
If more than one site shares the same Redis instance, give each one a unique cache key prefix in wp-config.php so their cached data never mixes. Here’s how:
- Connect to your server with an SFTP client (on xCloud you can also use the WP Config editor under WordPress → WP Config).
- Find your site’s root folder (often called public_html).
- Inside it, locate the wp-config.php file.
- Open the wp-config.php file using any text editor.
- Add the following line of code right after the first line, which is PHP’s opening tag (
<?php), replacing example.com with your own domain:
define( 'WP_CACHE_KEY_SALT', 'example.com:' );
Save the file, and Redis can run for this site without clashing with others on the same server.
How Caching Works in xCloud
In xCloud, we use two types of caching to boost website performance: page caching and object caching.
Let’s talk about page caching first. On Nginx servers, xCloud uses the Nginx FastCGI cache for this. It works like a super-fast library where we store web pages for instant access.

Now, let’s talk about object caching. This is all about storing specific pieces of information from the website’s database, like menus or post details. Instead of searching through the database every time someone needs this info, it’s already saved and ready to go. For this task, xCloud offers Redis object caching, which is different from full-page caching.
Note: Object caching involves storing the results of database queries, so they can be retrieved from the cache instead of querying the database again when the same result is needed.

Page and Object Caching With xSpeed Cache
New WordPress sites on xCloud get xSpeed Cache, made by the WPDeveloper team that also builds xCloud and wired straight into the dashboard, switched on with one toggle during site creation, marked Recommended. It covers both page caching and object caching in one plugin, so you don’t have to wire up Redis by hand.
Because xSpeed Cache already handles both layers, xCloud keeps its own Full Page Caching and Redis Object Caching toggles off for that site. Running both would conflict, so use one object cache per site. On OpenLiteSpeed servers, xSpeed Cache manages its own server rules, and the free plan is ready to use on xCloud; Pro features such as Critical CSS need an upgrade.
To clear it, go to Sites → [your site] → WordPress → Caching and click Purge Cache in the Clear xSpeed Cache panel. The xSpeed Cache setup doc walks through it with screenshots. Running WordPress somewhere else? The free plugin is on WordPress.org, and it works on Apache, nginx, LiteSpeed or any standard PHP host.
If you’d rather run the Redis Object Cache plugin yourself on an OpenLiteSpeed server, follow this guide, and read our OpenLiteSpeed overview for how that stack works.
Maximize WordPress Website Efficiency with Redis Object Caching
Redis object caching is a strong tool for WordPress performance. By storing and retrieving query results from memory, it cuts database load and speeds up the dynamic pages that page caching can’t help, like carts, account pages and wp-admin. Pair it with page caching, browser caching and edge caching for the best results.
If you have found this blog helpful, feel free to subscribe to our blogs for valuable tutorials, guides, knowledge, and tips on web hosting and server management. You can also join our Facebook community to share insights and engage in discussions.
Frequently asked questions
What is Redis object caching in WordPress?
Redis object caching stores the results of WordPress database queries in memory. When the same data is needed again, WordPress reads it from Redis instead of querying MySQL or MariaDB. This cuts database load and speeds up dynamic pages, including wp-admin.
What is the difference between page caching and object caching?
Page caching saves the finished HTML page and serves it to the next visitor without running PHP at all. Object caching saves individual pieces of data, such as query results, that PHP reuses while it builds a page. Most sites benefit from both, because page caching can’t help logged-in users, carts or admin screens.
Do I need to set up object caching myself on xCloud?
Not on a new WordPress site. xCloud installs and switches on xSpeed Cache during site creation, and it covers both page caching and object caching. xCloud keeps its own Full Page Caching and Redis Object Caching toggles off for that site, because running both would conflict.
Can Redis object caching break my site?
It can cause stale or mixed-up data if two sites share one Redis instance without a unique key prefix. Set a unique WP_CACHE_KEY_SALT in wp-config.php and test on a staging site first. If something looks wrong, purging the object cache usually fixes it.
Last updated September 28, 2026
← All articles