WordPress relies heavily on database queries to generate pages and serve dynamic content. Every page load, product search, cart update, or dashboard action can require WordPress to retrieve data from MySQL. On a small website, this may barely be noticeable. But as traffic, plugins, products, and dynamic requests increase, repeated database queries can become a significant performance bottleneck.
Page caching can reduce some of this work by serving previously generated pages, but it does not eliminate database queries for every type of request. Logged-in users, WooCommerce stores, membership sites, and other dynamic WordPress applications often still need to fetch data from the database.
This is where Redis object caching comes in. Redis stores frequently accessed WordPress objects in memory, allowing them to be retrieved faster without repeatedly querying the database.
In this guide, you’ll learn how Redis object caching works with WordPress, when it actually improves performance, how to set it up, how to measure whether it’s working, and how to troubleshoot and optimize Redis for production websites.
TL;DR
- What Redis does: Redis object caching stores frequently accessed WordPress data in memory, reducing repeated database queries and lowering database load.
- Who benefits: Redis is most useful for high-traffic, database-heavy websites, WooCommerce stores, membership sites, and WordPress sites with many logged-in or dynamic users.
- Redis vs. page cache: Redis caches database objects, while page caching stores generated pages. They solve different performance problems and can work together.
- WooCommerce: Redis can improve database-heavy operations such as product queries, dynamic requests, and logged-in customer experiences where full-page caching is limited.
- How to enable it: Install Redis on your server, install a compatible WordPress object-cache plugin, configure the Redis connection, and enable object caching.
- How to verify it works: Check the Redis plugin’s connection status and cache statistics, then compare database queries, response times, and server load before and after enabling Redis.
- When Redis isn’t necessary: Small, mostly static WordPress sites with low traffic and minimal database activity may see little benefit from adding Redis.
What Is Redis Object Caching in WordPress?
Redis object caching stores frequently accessed WordPress database objects in memory, allowing them to be retrieved faster without repeatedly querying MySQL. This reduces database load, speeds up dynamic requests, and can improve overall WordPress performance, particularly on high-traffic, WooCommerce, membership, and database-intensive websites.
What Is Redis?
Redis is an in-memory data store that keeps frequently accessed data in RAM instead of retrieving it from a database every time. Because RAM can be accessed much faster than disk-based database storage, Redis can significantly reduce the time needed to retrieve frequently requested data.
In WordPress, Redis is commonly used as an object cache. It stores reusable database objects—such as query results, options, and other frequently accessed data—so WordPress can retrieve them from memory instead of repeatedly querying MySQL.
The result is fewer database queries, lower database load, and faster response times, especially for dynamic WordPress websites.
How Redis Object Caching Fits Into WordPress
WordPress typically retrieves data from the MySQL database whenever it needs information to generate a response. Redis adds an in-memory caching layer between WordPress and the database, allowing frequently accessed objects to be retrieved without querying MySQL every time.
The basic WordPress stack looks like this:
Visitor
↓
Web Server
↓
PHP / WordPress
↓
Redis Object Cache
↓
MySQL Database
Without Redis
When Redis object caching isn’t enabled, WordPress generally has to query MySQL whenever it needs data that isn’t already available through another caching layer:
WordPress → MySQL → Result
For frequently requested data, repeating these database queries increases database activity and can add processing time, particularly on busy or database-intensive websites.
With Redis
When Redis is enabled, WordPress first checks whether the requested object is already stored in Redis:
WordPress → Redis → Cached Result
If the object is available, Redis returns it from memory without requiring another MySQL query. This can reduce database work and speed up repeated data retrieval.
What Happens When There Is a Cache Miss?
If Redis doesn’t contain the requested object, WordPress falls back to MySQL. After retrieving the data, WordPress can store the object in Redis so subsequent requests can retrieve it from memory:
WordPress → Redis → Cache Miss
↓
MySQL
↓
Store in Redis
↓
WordPress
This process is why Redis doesn’t replace MySQL. MySQL remains the primary database, while Redis provides a faster temporary storage layer for frequently accessed WordPress objects.
How Redis Handles WordPress Requests

Redis uses a simple cache hit and cache miss process to reduce repeated database queries.
Cache Hit
A cache hit happens when the requested WordPress object is already stored in Redis.
WordPress → Redis → Cached Object → WordPress
Redis returns the object from memory, so WordPress doesn’t need to query MySQL.
Cache Miss
A cache miss happens when the requested object isn’t available in Redis. WordPress then falls back to MySQL to retrieve the data.
WordPress → Redis → Cache Miss
↓
MySQL
↓
Store in Redis
↓
WordPress
Once the result is stored in Redis, future requests for the same object can retrieve it directly from memory.
Why Cache Hits Matter
The more frequently WordPress can serve repeated requests from Redis, the fewer database queries it needs to make. This can reduce database workload and improve response times, particularly on sites with frequent dynamic requests.
Redis vs. Page Cache: What’s the Difference?
Redis object caching and page caching both improve WordPress performance, but they work at different levels of the stack.
Redis caches frequently accessed database objects in memory, while page caching stores complete, generated pages so they can be served without running WordPress and PHP for every request.
| Redis Object Cache | Page Cache | |
|---|---|---|
| What it stores | Database objects and query results | Complete generated pages |
| Main goal | Reduce database queries | Avoid regenerating pages |
| Works at | Object/data level | Full-page level |
| Logged-in users | ✅ Useful | ⚠️ Often limited |
| Dynamic requests | ✅ Useful | ⚠️ Often bypassed |
| WooCommerce | ✅ Particularly useful | ⚠️ Limited for dynamic areas |
| Reduces database load | ✅ Directly | ✅ Indirectly |
| Can work together? | ✅ Yes | ✅ Yes |
How They Work Together
A typical optimized WordPress stack can use both:
Visitor
↓
Page Cache
↓
Cached Page → Return Response
│
└── Cache Miss
↓
PHP / WordPress
↓
Redis Object Cache
↓
MySQL
Page caching handles requests that can be served as complete cached pages, while Redis helps WordPress retrieve frequently used data faster when PHP and the database still need to run.
Can Redis Replace Page Caching?
No. Redis and page caching solve different performance problems. Redis reduces the work required to retrieve data from the database, while page caching can bypass much of the WordPress/PHP execution process altogether.
For dynamic or database-heavy WordPress websites, using Redis alongside page caching can provide broader performance benefits than relying on either layer alone.
Redis for WooCommerce: Why It Matters
WooCommerce sites often generate more database activity than simple WordPress blogs because they handle products, variations, customer accounts, orders, carts, and other dynamic data. As the store grows, repeatedly retrieving this data can increase database load and affect response times.
Redis object caching can help by keeping frequently accessed WordPress and WooCommerce objects in memory, reducing the need to retrieve the same data from MySQL repeatedly.
Where Redis Can Help WooCommerce
Redis can be particularly useful for:
- Product and catalog queries: Frequently accessed product data can be retrieved from memory instead of repeatedly querying MySQL.
- Product filtering and search: Database-heavy catalog operations can benefit when frequently requested objects are cached.
- Logged-in customers: Because full-page caching is often limited for logged-in users, object caching can still improve data retrieval.
- Cart and dynamic requests: Redis can help with database operations that cannot simply be served from a full-page cache.
- Large product catalogs: Stores with many products, variations, and database-intensive operations can place significant load on MySQL.
- High-traffic stores: Reducing repeated database queries can help the server handle more concurrent requests.
Redis Doesn’t Replace WooCommerce Page Caching
WooCommerce requires dynamic content, so not every request can be served from a page cache. Redis complements page caching by optimizing the database and object layer behind those dynamic requests.
A typical WooCommerce stack can look like:
Customer
↓
Page Cache
↓
PHP / WooCommerce
↓
Redis Object Cache
↓
MySQL
Page caching handles requests that can safely be cached as complete pages, while Redis helps WooCommerce retrieve frequently used data when WordPress still needs to execute.
When Redis Won’t Fix WooCommerce Performance
Redis is not a universal fix for a slow WooCommerce store. It won’t automatically resolve problems caused by:
- Poorly optimized plugins or themes
- Slow or inefficient database queries
- External API requests
- Unoptimized images and frontend assets
- Excessive JavaScript
- Slow third-party services
- Insufficient server resources
Redis works best as one layer of a broader WooCommerce performance strategy, alongside page caching, database optimization, PHP optimization, CDN delivery, and properly sized server resources.
How to Know if Redis Is Actually Working
Enabling Redis does not necessarily mean WordPress is using it effectively. You should verify the connection, confirm that objects are being cached, and compare performance before and after enabling Redis.
1. Check the Redis Connection
Your Redis object-cache plugin should report that Redis is connected and that object caching is active. If it shows “Not Connected” or a similar error, WordPress is not communicating with Redis correctly.
2. Check Cache Hits and Misses
Redis should show activity as WordPress requests and retrieves cached objects.
Request
↓
Redis
├── Cache Hit → Return cached object
└── Cache Miss → MySQL → Store object in Redis
A healthy setup should generate cache hits as frequently requested objects are reused.
3. Check WordPress Database Queries
Use a tool such as Query Monitor to compare database activity before and after enabling Redis. A reduction in repeated queries can indicate that object caching is reducing database work.
4. Monitor Server Performance
Look at metrics such as:
- Database CPU usage
- PHP response time
- MySQL queries
- Server memory usage
- Time to first byte (TTFB)
The goal isn’t simply to see that Redis is connected, but to determine whether it is reducing work elsewhere in the stack.
5. Compare Before and After
For the most reliable test, measure your site before enabling Redis and then repeat the same test afterward.
A Redis connection confirms that caching is enabled; improved cache activity and reduced database workload help confirm that it is actually benefiting your WordPress site.
How to Measure Redis Performance in WordPress
Simply connecting Redis isn’t enough to prove that it is improving your WordPress site. Measure performance before and after enabling object caching to see whether Redis is reducing database work and improving response times.
Key Metrics to Monitor
| Metric | What It Tells You |
|---|---|
| TTFB | How quickly the server begins responding to a request |
| Database query count | Whether WordPress is making fewer database queries |
| Query execution time | How much time WordPress spends running database queries |
| Redis hit ratio | How often requested objects are found in Redis |
| Cache misses | How often Redis needs to fall back to another data source |
| CPU usage | Whether reduced database work lowers server processing load |
| MySQL load | Whether Redis is reducing pressure on the database |
| PHP execution time | Whether WordPress can generate responses more efficiently |
| Memory usage | How much RAM Redis and the rest of the stack consume |
What Should Improve?
After enabling Redis, you may see:
Redis Cache Hits ↑
Redis Cache Misses ↓
Database Queries ↓
MySQL Load ↓
PHP Execution Time ↓
TTFB ↓
The exact improvement depends on the website, workload, existing caching layers, and server resources. A simple blog with mostly cached pages may see little change, while a database-heavy WooCommerce or membership site can benefit more.
Test Before and After
For a meaningful comparison, test the same pages and workflows before and after enabling Redis. Look at both application-level metrics—such as queries and PHP execution time – and server-level metrics such as CPU, MySQL load, and memory usage.
The goal isn’t to make Redis metrics look good; it’s to confirm that Redis is reducing database work and improving the performance of requests that actually need object caching.
How to Enable Redis Object Caching in WordPress
There are several ways to enable Redis object caching in WordPress, depending on how your hosting environment is managed. The underlying process is similar; you need a running Redis instance, a way for PHP to communicate with it, and a WordPress object-cache integration.
Option 1: Managed WordPress Hosting
Some managed WordPress hosting providers include Redis as part of their hosting stack. In this case, the hosting provider typically handles the Redis installation, server configuration, networking, and maintenance.
The exact process varies by provider, but it usually involves:
- Confirming that Redis object caching is supported.
- Enabling Redis from the hosting control panel or contacting support.
- Installing or activating the required WordPress object-cache integration.
- Verifying that WordPress can connect to Redis.
- Checking that cached objects are being served.
Best for: Website owners who want the benefits of Redis without managing server infrastructure themselves.
Option 2: VPS or Dedicated Server
If you manage your own VPS or dedicated server, you’ll need to install and configure Redis yourself.
A typical setup involves:
- Install Redis on the server.
- Install the PHP Redis extension (
php-redis/PhpRedis) for the PHP version running WordPress. - Secure the Redis service and restrict access to trusted connections.
- Install a WordPress Redis object-cache plugin.
- Configure the Redis connection using your WordPress configuration.
- Enable object caching from the plugin.
- Verify the connection and confirm that Redis is serving cached objects.
For example, a WordPress configuration may define the Redis host and port like this:
define( 'WP_REDIS_HOST', '127.0.0.1' );
define( 'WP_REDIS_PORT', 6379 );
The exact configuration depends on your server architecture. If Redis runs in a separate Docker container, for example, the Redis hostname will typically be the container or service name rather than 127.0.0.1.
Best for: Developers and server administrators who want full control over their WordPress infrastructure.
Option 3: Docker
When WordPress runs in Docker, Redis can run as a separate container on the same Docker network.
A simplified architecture looks like this:
WordPress Container
↓
Docker Network
↓
Redis Container
↓
Redis Objects
A typical Docker-based setup involves:
- Create a Redis container.
- Connect Redis and WordPress to the same Docker network.
- Configure WordPress to use the Redis service name as its host.
- Install and activate a Redis object-cache plugin.
- Verify that WordPress can communicate with the Redis container.
- Monitor Redis memory usage and cache activity.
For example, if the Redis service in your Docker Compose configuration is named redis, WordPress would typically connect to redis rather than localhost.
Best for: Developers and teams using containerized WordPress environments who want consistent and isolated infrastructure.
Option 4: FlyWP
FlyWP provides a managed way to run Redis alongside Docker-powered WordPress sites. Instead of manually installing Redis, configuring container networking, and managing the connection yourself, you can enable Redis from the FlyWP dashboard.
The general workflow is:
- Create or connect your WordPress server.
- Enable Redis object caching.
- FlyWP handles the underlying Redis and Docker networking configuration.
- Verify that object caching is active.
- Manage or clear the cache from the dashboard when needed.
This approach is useful when you want Docker-based infrastructure without having to manually manage every component of the Redis stack.
Note: The exact Redis configuration and available controls can vary depending on your hosting environment and platform. Always verify the connection after enabling object caching rather than assuming Redis is working simply because it has been activated.
Using Redis with WordPress in Docker
Docker makes it possible to run WordPress, Redis, and MySQL as separate containers while allowing them to communicate through a private Docker network. This keeps each service isolated while creating a predictable environment for running a WordPress stack.
A typical architecture looks like this:
WordPress
Container
│
Docker Network
┌────┴────┐
↓ ↓
Redis MySQL
Container Container
Redis Container
The Redis container runs the Redis service and stores frequently accessed WordPress objects in memory. WordPress communicates with this container through the Docker network rather than treating Redis as part of the WordPress container.
WordPress Container
The WordPress container runs the application itself, including PHP and the WordPress code. When WordPress needs a cached object, it communicates with Redis through the internal Docker network.
MySQL Container
MySQL remains the primary database for WordPress. Redis doesn’t replace MySQL; it provides a faster in-memory layer for frequently accessed objects.
The request flow is therefore:
WordPress → Redis → Cache Hit
│
└────────────→ MySQL → Cache Miss
Docker Network
The containers need to share a Docker network so WordPress can communicate with Redis and MySQL using their internal service names.
This also means Redis does not need to be publicly exposed to the internet just for WordPress to use it.
Redis Hostname and Port
One of the most important differences between a traditional server setup and Docker is how WordPress identifies the Redis server.
In a traditional setup, Redis may run on the same server as WordPress, so the configuration can use:
127.0.0.1:6379
With Docker, Redis commonly runs in a separate container. If the Redis service is named redis, WordPress would typically connect to:
redis:6379
Inside Docker, localhost refers to the WordPress container itself—not the Redis container. Using localhost when Redis is running in another container will therefore usually fail.
Redis Persistence
Redis object caching is generally used as temporary application data rather than as the primary source of truth. WordPress data remains stored in MySQL, so losing the Redis cache does not mean losing the underlying WordPress database.
Depending on your Redis configuration and use case, you can also configure persistent storage for Redis. However, persistence requirements should be considered separately from WordPress database backups.
Running Multiple WordPress Sites
Docker also makes it possible to run multiple WordPress sites alongside Redis.
For example:
Docker Network
│
┌────────────────┼────────────────┐
↓ ↓ ↓
WordPress A WordPress B WordPress C
│ │ │
└────────────────┼────────────────┘
↓
Redis
│
MySQL
For multiple sites, your Redis configuration should use appropriate key prefixes or namespaces to prevent cached objects from different WordPress installations from conflicting.
Why Docker + Redis Works Well
The main advantage is separation of services. WordPress, Redis, and MySQL can be managed independently while communicating over a private network.
For developers and agencies running multiple WordPress environments, this architecture provides a consistent way to deploy Redis without installing and configuring every service directly on the host operating system.
Platforms such as FlyWP build on this architecture by managing the Docker-based infrastructure and Redis configuration, reducing the amount of manual networking and server configuration required.
Redis Configuration Best Practices for WordPress
A Redis connection can work with the default settings, but a few configuration choices can improve reliability and prevent common connection or cache conflicts. Most WordPress sites only need a handful of settings.
WP_REDIS_HOST
WP_REDIS_HOST specifies the hostname or IP address WordPress should use to connect to Redis.
For Redis running on the same server:
define( 'WP_REDIS_HOST', '127.0.0.1' );
For Docker, use the Redis service or container hostname:
define( 'WP_REDIS_HOST', 'redis' );
Important: localhost refers to the current container in a Docker environment, not another Redis container.
WP_REDIS_PORT
WP_REDIS_PORT specifies the port Redis is listening on. The default Redis port is 6379.
define( 'WP_REDIS_PORT', 6379 );
You generally don’t need to change this unless your Redis server is configured to use another port.
WP_REDIS_PREFIX
The Redis key prefix helps separate cached objects belonging to different WordPress installations.
define( 'WP_REDIS_PREFIX', 'mysite:' );
This becomes particularly important when multiple WordPress sites share the same Redis instance. Give each site a unique prefix to prevent cache keys from overlapping.
Connection Timeout
The connection timeout determines how long WordPress waits when attempting to communicate with Redis.
A reasonable timeout helps prevent Redis connection problems from unnecessarily delaying WordPress requests. The appropriate value depends on your server and network architecture, so avoid using an unnecessarily long timeout.
Database Selection
Redis can use numbered logical databases, allowing different applications or environments to keep their keys separated within the same Redis instance.
For example:
define( 'WP_REDIS_DATABASE', 0 );
However, key prefixes are generally more useful for separating WordPress sites, particularly when managing multiple installations.
PHP Redis Extension
WordPress needs a way for PHP to communicate with Redis. PhpRedis is a commonly used PHP extension for this purpose.
Before troubleshooting WordPress configuration, confirm that the Redis PHP extension is installed and enabled for the same PHP version running your WordPress site.
If PHP cannot communicate with Redis, changing WP_REDIS_HOST or WP_REDIS_PORT won’t solve the underlying problem.
Persistent Connections
Persistent Redis connections allow PHP processes to reuse existing Redis connections instead of establishing a new connection for every request.
This can reduce connection overhead on busy websites, but the benefit depends on the server architecture, PHP-FPM configuration, Redis workload, and object-cache implementation.
For most WordPress sites, start with the basic host, port, prefix, and PHP Redis configuration. Only tune connection behavior or other advanced settings after measuring the workload and identifying a specific performance or reliability need.
How Much Memory Does Redis Need for WordPress?
Redis stores cached WordPress objects in RAM, so the amount of memory it needs depends on how much data your site regularly caches. There is no single memory requirement that fits every WordPress installation.
Several factors influence Redis memory usage:
- Site and database size: Larger, more complex sites generally have more objects that can be cached.
- Traffic and workload: Sites with frequent requests can accumulate and reuse more cached objects.
- WooCommerce: Stores may cache more dynamic data related to products, customers, sessions, and other database operations.
- Multiple WordPress sites: Sharing one Redis instance across several sites increases overall memory requirements.
- Cache configuration: The object-cache plugin, key prefixes, expiration settings, and workload all affect how much data Redis retains.
The best approach is to monitor actual Redis memory usage rather than assigning memory based only on the size of your WordPress database. A 10 GB WordPress database does not mean Redis needs 10 GB of RAM because Redis only stores the objects that are being cached.
What Happens When Redis Runs Out of Memory?
Redis has a configurable memory limit. When the instance reaches that limit, its behavior depends on the configured eviction policy.
An eviction policy determines which cached keys Redis removes when it needs to make room for new data.
For example, a policy may remove:
- The least recently used keys
- Keys that are close to their expiration time
- Random keys
- No keys at all, causing new writes to be rejected once the limit is reached
For WordPress object caching, eviction is generally preferable to allowing Redis to consume unlimited memory. If frequently used objects are evicted too aggressively, however, cache misses can increase and reduce the performance benefit of object caching.
How to Manage Redis Memory
For a healthy WordPress Redis setup:
- Set an appropriate memory limit based on available server RAM and workload.
- Monitor Redis memory usage regularly.
- Watch for evictions and increasing cache misses.
- Avoid allocating so much RAM to Redis that it competes with MySQL, PHP, or the operating system.
- For multiple WordPress sites, monitor aggregate Redis usage rather than looking at each site in isolation.
The goal isn’t to allocate as much RAM as possible to Redis. The goal is to give Redis enough memory to retain useful cached objects without starving the rest of your WordPress stack.
How to Monitor Redis on WordPress

Enabling Redis is only the first step. Monitoring Redis helps you confirm that it is available, handling requests efficiently, and using memory appropriately without becoming a new bottleneck.
Key metrics to watch include memory usage, connected clients, commands, cache hits, cache misses, evictions, errors, and Redis availability.
What Should You Monitor?
| Metric | What It Tells You | What to Watch For |
|---|---|---|
| Memory usage | How much RAM Redis is consuming | Consistently high or rapidly increasing usage |
| Connected clients | Number of active connections to Redis | Unexpected spikes or excessive connections |
| Commands | How many operations Redis is processing | Sudden changes that correlate with traffic or application issues |
| Cache hits | How often requested objects are found in Redis | Increasing hits generally indicate effective cache reuse |
| Cache misses | How often requested objects aren’t found | A consistently high rate may indicate poor cache reuse or configuration issues |
| Evictions | How often Redis removes keys because of memory limits | Frequent evictions can indicate insufficient memory or an unsuitable configuration |
| Errors | Redis connection and command failures | Unexpected or increasing errors |
| Availability | Whether Redis is reachable and responding | Downtime, connection failures, or intermittent availability |
Focus on Trends, Not Individual Numbers
A single cache miss or temporary CPU spike doesn’t necessarily indicate a problem. Redis performance should be evaluated over time and alongside WordPress and server metrics.
For example, high memory usage combined with frequent evictions and increasing cache misses is more concerning than high memory usage alone. Similarly, a sudden increase in Redis errors alongside slower PHP response times may indicate a connection or infrastructure problem.
The goal of Redis monitoring is to confirm that the cache is available, being reused effectively, and operating within the resources allocated to it.
Common Redis Problems in WordPress
Redis can improve WordPress performance, but connection, configuration, and resource issues can prevent it from working as expected. The troubleshooting process usually comes down to checking the Redis service, connection details, PHP integration, and server resources.
Redis Says “Not Connected”
Problem: Your Redis object-cache plugin reports that Redis is not connected.
Cause: WordPress cannot establish a connection to the Redis server. Common causes include an incorrect host or port, a stopped Redis service, a missing PHP Redis extension, or incorrect credentials.
Fix: Confirm that Redis is running, verify the configured host and port, check that the PHP Redis extension is available, and review the plugin’s connection status or error message.
Redis Connection Refused
Problem: WordPress reports a “connection refused” error when trying to connect to Redis.
Cause: Redis may not be running, may not be listening on the expected port, or a firewall or network rule may be blocking the connection.
Fix: Check that the Redis service is running and listening on the configured port. If WordPress and Redis are on different containers or servers, also verify that they can communicate over the required network.
Redis Timeout
Problem: WordPress takes too long to connect to Redis or reports a connection timeout.
Cause: The Redis server may be unreachable, overloaded, incorrectly configured, or separated from WordPress by a network or firewall problem.
Fix: Verify network connectivity, Redis availability, firewall rules, and connection settings. If Redis is consistently reachable but slow to respond, check its resource usage and connected clients.
Wrong Redis Host
Problem: Redis is running, but WordPress cannot connect to it.
Cause: WP_REDIS_HOST points to the wrong hostname or IP address. This is especially common with Docker deployments.
Fix: Confirm the hostname used by your Redis service. In Docker, WordPress typically connects using the Redis service or container hostname, such asredis, rather than 127.0.0.1.
define( 'WP_REDIS_HOST', 'redis' );
Wrong Redis Port
Problem: WordPress cannot connect even though the Redis server is running.
Cause: WordPress is attempting to connect to a port that Redis isn’t listening on.
Fix: Confirm the Redis listening port and make sure WP_REDIS_PORT matches it. The default Redis port is 6379.
define( 'WP_REDIS_PORT', 6379 );
PHP Redis Extension Is Missing
Problem: Redis is running, but WordPress cannot communicate with it through PHP.
Cause: The PHP Redis extension, commonly PhpRedis, isn’t installed or enabled for the PHP version used by WordPress.
Fix: Check the active PHP version and confirm that the Redis extension is installed and enabled for that version. After making changes, restart the relevant PHP service if required and test the Redis connection again.
Redis Works but Doesn’t Improve Performance
Problem: Redis reports that it is connected, but the website doesn’t become noticeably faster.
Cause: Redis may not be the primary bottleneck. The site may already rely heavily on page caching, have relatively few database-intensive requests, or have performance problems caused by plugins, themes, external APIs, frontend assets, or insufficient server resources.
Fix: Compare database queries, query execution time, PHP execution time, TTFB, MySQL load, and Redis hit/miss activity before and after enabling object caching. Use the results to determine whether Redis is actually reducing database work.
Redis Uses Too Much Memory
Problem: Redis consumes a large amount of available RAM or approaches its configured memory limit.
Cause: A high-volume site, multiple WordPress installations, large numbers of cached objects, or an inappropriate memory configuration can increase Redis usage.
Fix: Monitor Redis memory usage and eviction activity, set an appropriate memory limit, and review your cache configuration. Make sure Redis isn’t consuming resources needed by MySQL, PHP, or the operating system.
Redis Cache Keeps Getting Flushed
Problem: Cached objects disappear frequently, resulting in repeated cache misses.
Cause: Redis may be restarting, reaching its memory limit and evicting keys, or being deliberately flushed by a plugin, deployment, server process, or administrator.
Fix: Check Redis logs, restart events, memory usage, eviction statistics, and any automated cache-clearing processes. If Redis is running in Docker, also check the container’s restart behavior and resource limits.
Docker WordPress Cannot Connect to Redis
Problem: WordPress runs in one Docker container, Redis runs in another, but WordPress cannot establish a connection.
Cause: The containers may not share the same Docker network, or WordPress may be configured to use localhost instead of the Redis service name.
Fix: Make sure both containers are connected to the same Docker network and configure WordPress with the Redis service hostname:
define( 'WP_REDIS_HOST', 'redis' );
define( 'WP_REDIS_PORT', 6379 );
Remember that localhost inside the WordPress container refers to the WordPress container itself, not the separate Redis container.
Quick Troubleshooting Checklist
When Redis isn’t working as expected, check these in order:
Redis running?
↓
Correct host and port?
↓
WordPress can reach Redis?
↓
PHP Redis extension available?
↓
Object-cache plugin connected?
↓
Cache hits being generated?
↓
Redis memory and evictions healthy?
↓
Performance actually improving?
This approach helps distinguish a Redis connection problem from a situation where Redis is working correctly but simply isn’t the main performance bottleneck.
Redis Security Best Practices for WordPress
Redis can contain cached WordPress data, so it should be treated as an internal infrastructure service rather than a publicly accessible application. A secure Redis setup limits who can connect to it and protects communication between WordPress and Redis.
Don’t Expose Port 6379 Publicly
Port 6379 is Redis’s default port and should not be exposed directly to the public internet. Exposing Redis can allow unauthorized users to connect to the service and potentially access or manipulate cached data.
Instead, keep Redis accessible only to WordPress and other trusted services.
Use a Firewall
Configure your server firewall to block public access to Redis while allowing connections from the systems that actually need it.
For a typical WordPress stack, Redis should only accept connections from the WordPress application or trusted internal network.
Use a Private Network
When WordPress and Redis run on separate servers, connect them through a private network whenever possible. This keeps Redis traffic away from the public internet and reduces the attack surface.
With Docker, Redis can communicate with WordPress through an internal Docker network without publishing Redis’s port to the host.
Enable Authentication
If Redis needs to accept connections beyond a tightly controlled local environment, configure authentication so clients must provide valid credentials before accessing the service.
Authentication should be treated as an additional security layer, not a replacement for network restrictions and firewall rules.
Consider Redis ACLs
Redis Access Control Lists (ACLs) provide more granular control over which users can connect and what commands they can execute.
For environments with multiple applications or users, ACLs can help follow the principle of least privilege by limiting access to only what each client requires.
Use TLS Where Appropriate
If Redis traffic travels across a network that isn’t fully trusted, TLS encryption can protect data while it is in transit.
Whether TLS is necessary depends on your infrastructure. For Redis running inside a private Docker network on the same server, the security requirements are different from Redis communicating between separate servers over a network.
Use Docker Network Isolation
With containerized WordPress, keep Redis on a private Docker network and avoid publishing its port unless external access is genuinely required.
Internet
↓
Web Server
↓
WordPress Container
│
└── Private Docker Network
↓
Redis Container
This provides network-level isolation while allowing WordPress to communicate with Redis normally.
Restrict SSH Access
SSH can be useful for administering Redis servers, checking logs, and troubleshooting configuration. However, SSH access should also be restricted to trusted users and systems.
Use SSH keys instead of password authentication where practical, limit unnecessary access, and avoid exposing additional administrative services without a clear need.
Redis Security Checklist
Before putting Redis into production, verify:
- ✅ Port 6379 isn’t publicly accessible
- ✅ Firewall rules restrict Redis connections
- ✅ Redis uses a private network where possible
- ✅ Authentication is configured when required
- ✅ ACLs are used when granular permissions are needed
- ✅ TLS is considered for network traffic that requires encryption
- ✅ Docker Redis containers aren’t unnecessarily exposed
- ✅ SSH access is restricted to trusted administrators
The most important rule is simple: Redis should not be directly exposed to the public internet. Keep it behind your firewall or private network and allow only the WordPress application and trusted services to connect.
Best Redis Object Cache Options for WordPress
WordPress supports persistent object caching through external caching systems such as Redis. The right option depends on your site’s traffic, technical requirements, hosting environment, and how much control you need over the caching layer.
| Solution | Best for | Cost | Advanced features | Complexity |
|---|---|---|---|---|
| Redis Object Cache | Most WordPress sites | Free | PhpRedis, Relay, clustering, replication, Sentinel, WP-CLI | Low–Medium |
| Object Cache Pro | High-traffic & demanding WordPress sites | Paid | Prefetching, analytics, compression, TLS, health checks, WooCommerce optimization | Medium |
| Relay | Performance-focused PHP environments | Depends on setup | Local in-memory caching, shared cache across PHP-FPM workers, reduced Redis network overhead | Medium–High |
| Hosting/platform-managed Redis | Users who don’t want to manage Redis infrastructure | Varies by provider | Managed setup, networking, monitoring, cache management | Low |
Redis Object Cache
Redis Object Cache is the most straightforward starting point for most WordPress sites. It provides a persistent Redis-backed object cache and supports clients such as PhpRedis and Relay, along with advanced Redis configurations including replication, Sentinel, clustering, and WP-CLI.
Best for: Blogs, business sites, WooCommerce stores, and developers who want a flexible free solution.
Object Cache Pro
Object Cache Pro is a commercial option designed for more demanding WordPress environments. It adds features such as cache prefetching, analytics, compression, health checks, TLS support, and optimizations for WooCommerce and other popular plugins.
Best for: High-traffic sites, WooCommerce stores, and teams that need advanced performance and monitoring capabilities.
Relay
Relay is a PHP extension that works as a replacement for PhpRedis while also maintaining a shared in-memory cache across PHP-FPM workers. This can reduce the number of requests that need to travel between PHP and Redis.
Best for: Performance-focused environments where reducing Redis network overhead is important.
Hosting- or Platform-Managed Redis
Managed hosting platforms can handle the underlying Redis installation, networking, configuration, and maintenance for you. This is useful when you want persistent object caching without manually administering Redis on your server.
Best for: Website owners, agencies, and developers who prefer managed infrastructure over manually configuring Redis.
Which Redis Option Should You Choose?
For most WordPress websites, Redis Object Cache is a sensible starting point. More demanding sites may benefit from Object Cache Pro or Relay, while managed Redis is often the simplest choice when you don’t want to manage the infrastructure yourself.
The important distinction is that Redis itself is the caching backend; these options determine how WordPress connects to, manages, and optimizes that backend.
Redis vs. Memcached for WordPress
Redis is generally the more feature-rich choice for WordPress object caching, while Memcached is a simpler in-memory caching system. Both can reduce database load by storing frequently accessed data in memory, but they differ in capabilities and configuration options.
| Feature | Redis | Memcached |
|---|---|---|
| Data storage | In-memory | In-memory |
| WordPress object caching | ✅ | ✅ |
| Data structures | Multiple data types | Simple key-value |
| Persistence options | ✅ | ❌ |
| Replication | ✅ | Limited |
| Clustering | ✅ | ✅ |
| Advanced access control | ✅ | Limited |
| Configuration flexibility | High | Simple |
| Best suited for | Complex & demanding workloads | Simple caching workloads |
When Should You Choose Redis?
Redis is a strong choice when you need more than basic key-value caching. Its broader feature set makes it suitable for high-traffic WordPress sites, WooCommerce stores, multisite installations, and environments where advanced monitoring, replication, clustering, or access controls may be useful.
It also integrates well with modern containerized WordPress environments.
When Does Memcached Make Sense?
Memcached can be a good option when you need a simple, lightweight object cache and don’t require Redis-specific capabilities. If your hosting environment already provides Memcached and your site’s caching requirements are straightforward, there may be little reason to switch.
Redis or Memcached: Which Is Better for WordPress?
For most new WordPress deployments, Redis is the more flexible long-term choice, particularly when the site may grow or require advanced caching capabilities. However, Memcached remains a practical option for simpler workloads where basic object caching is all that’s required.
Does Every WordPress Site Need Redis?
No, not every WordPress site needs Redis. Redis is most valuable when WordPress generates frequent database queries or handles dynamic requests that cannot be fully served by page caching.
Redis can provide the most noticeable benefits when a site has:
- High database activity: Frequent or expensive database queries can create a bottleneck that object caching helps reduce.
- Frequent dynamic requests: Sites with content that changes or cannot be fully page-cached can benefit from faster object retrieval.
- Many logged-in users: Dashboards, membership areas, and other authenticated experiences often bypass full-page caching, making object caching more useful.
- WooCommerce: Online stores generate many database-intensive and dynamic requests, particularly as product catalogs and customer activity grow.
- Growing traffic: As concurrent requests increase, reducing repeated database work can help the server handle the workload more efficiently.
- Repeated expensive queries: If WordPress repeatedly requests the same database objects, storing those objects in Redis can reduce unnecessary database work.
When Redis May Not Be Necessary
A small WordPress site with low traffic, mostly static content, minimal database activity, and effective page caching may see little measurable improvement from Redis.
In that situation, optimizing images, plugins, database queries, page caching, PHP, and frontend assets may provide a greater performance benefit.
Redis should be added because your workload benefits from object caching, not simply because it is available. Before and after measurements can help determine whether Redis is actually addressing your site’s performance bottleneck.
How FlyWP Simplifies Redis for WordPress

Running Redis manually gives you control, but it also adds another infrastructure component to install, configure, connect, monitor, and maintain. For teams managing multiple WordPress sites, keeping Redis, Docker networking, WordPress configuration, and server resources working together can become an ongoing operational task.
FlyWP takes a managed approach by running WordPress in a Docker-powered environment and handling the underlying Redis configuration through the server management platform.
One-Click Redis
Instead of manually installing Redis and configuring the WordPress connection, you can enable Redis from the FlyWP dashboard. This reduces the number of server-level steps required to get object caching running.
Docker Networking
Because FlyWP uses Docker-based WordPress infrastructure, Redis can communicate with WordPress through the appropriate internal Docker network. This avoids having to manually configure container networking and Redis connection details.
WordPress Integration
FlyWP handles the connection between the WordPress site and Redis as part of the managed setup, so you don’t need to manually maintain configuration such as Redis host and port settings for each deployment.
Cache Management
Redis object caching can be managed alongside the rest of the WordPress infrastructure, including clearing the relevant cache when troubleshooting or making changes.
Server Management and Monitoring
Redis is only one component of a WordPress server. FlyWP brings Redis management into the same environment as server configuration, backups, security, monitoring, SSL, and other WordPress management tasks, reducing the need to manage each infrastructure component separately.
The difference is ultimately about where the operational work happens:
Manual Setup
Redis Installation
↓
PHP Configuration
↓
Docker Networking
↓
WordPress Integration
↓
Monitoring & Maintenance
FlyWP
Server Management
↓
Enable Redis
↓
Managed Docker Infrastructure
↓
WordPress + Redis
↓
Manage from FlyWP
FlyWP doesn’t change what Redis does; it simplifies the infrastructure work required to run Redis alongside WordPress. This can be particularly useful for developers and agencies managing multiple Docker-based WordPress sites.
up. For one site, it is manageable. For an agency running dozens of client sites, it becomes a recurring tax on your time.
FAQ
Redis object caching stores frequently accessed WordPress data in memory so it can be retrieved without repeatedly querying the MySQL database. This reduces database workload and can improve performance, particularly for dynamic and database-intensive websites.
Yes, Redis can make WordPress faster by reducing repeated database queries and retrieving cached objects from memory. The actual improvement depends on the site’s workload, existing caching, database activity, and server resources.
Redis is not a replacement for page caching because they optimize different parts of WordPress. Redis caches database objects, while page caching stores generated pages; using both can provide broader performance benefits.
No, WooCommerce does not require Redis, but Redis can be particularly useful for database-heavy or high-traffic stores. It can help reduce repeated database work for product queries, dynamic requests, and logged-in customer experiences where full-page caching is limited.
Page caching stores finished HTML pages, while Redis object caching stores individual database query results. Page caching serves anonymous visitors without running WordPress, and Redis speeds up dynamic and logged-in requests. The best setups use both layers together.
Check that your Redis object-cache plugin reports an active connection and that Redis is recording cache activity. You can also compare database queries, query execution time, TTFB, and server resource usage before and after enabling Redis.
Redis object caching can fail because of an incorrect host or port, a stopped Redis service, a missing PHP Redis extension, network restrictions, or incorrect WordPress configuration. Check the Redis service, connection settings, PHP extension, Docker networking, and object-cache plugin status to identify the problem.
Not always. A small, low-traffic site with mostly static pages may run fine on page caching alone. Redis becomes worthwhile once you add WooCommerce, memberships, heavy plugins, or steady traffic that strains the database.
There is no fixed RAM requirement because Redis memory usage depends on the site’s traffic, cached objects, WooCommerce workload, and number of WordPress sites sharing the instance. Monitor actual Redis memory usage and evictions rather than sizing Redis solely from the WordPress database size.
Yes, Redis can be safely used with WordPress when it is properly secured and kept off the public internet. Restrict access with firewalls and private networks, use authentication and ACLs when appropriate, and consider TLS when Redis traffic crosses a network that requires encryption.
Yes, Redis can run in a separate Docker container alongside WordPress and MySQL. WordPress and Redis should share an appropriate Docker network, and WordPress typically connects to Redis using its service or container hostname rather than localhost.
No, small sites with low traffic, minimal database activity, and effective page caching may see little benefit from Redis. Redis becomes more valuable when a site has frequent dynamic requests, many logged-in users, WooCommerce workloads, growing traffic, or repeated expensive database queries.
Conclusion
Redis earns its place in modern WordPress infrastructure by solving a problem that nothing else solves as cleanly. It removes repeated database work, the slowest part of building most pages, and serves that data from memory instead.
The result shows up everywhere. Faster database queries, lower server load, a quicker admin dashboard, and the ability to handle more traffic on the same hardware. Page caching covers anonymous visitors, and Redis covers everything page caching cannot reach.
That gap is exactly where WooCommerce lives. Carts, checkouts, and account pages skip page caching entirely, so a store without object caching leaves its most important pages running raw against the database. For any serious WooCommerce site, Redis is close to a baseline requirement rather than an optimization.
This is why Redis has shifted from an advanced tweak to an expected layer of a healthy WordPress stack. The remaining hurdle is operational, since installing, wiring up, and maintaining Redis takes real server work, especially across many sites.
Platforms built for this make the decision easy. FlyWP ships Redis as part of a Docker-powered WordPress stack and lets you enable object caching with a toggle, so you get the performance without the plumbing. Whether you run it yourself or let a managed platform handle it, adding Redis is one of the highest-value moves available for WordPress performance optimization.