Redis object caching for WordPress: does it actually make your site faster?
9 min read · 25-Jun-2025
villagehosting.in team
25 June 2025
Redis is one of those technologies that gets recommended confidently without much explanation of whether it will actually help your site. Here is the honest answer — what it does, when it helps, and when it does not.
Redis requires a VPS
Redis is a server-side in-memory store. It requires root access to install and runs as a system service. Redis is not available on shared cPanel hosting — it requires a VPS or dedicated server. If you're on shared hosting, use a disk-based transient cache instead (W3 Total Cache supports this).
What WordPress object caching is
Every time WordPress generates a page, it runs dozens of database queries — fetching posts, menus, widgets, options, user data, and plugin settings. Without caching, every page request runs all of these queries from scratch.
WordPress has a built-in object cache (WP_Object_Cache) that stores query results in memory during a single page request. The problem: the cache is cleared at the end of each request. The next request starts fresh.
Redis (or Memcached) provides a persistent object cache that survives across requests. A query result cached during request #1 is available instantly for request #2 without touching the database.
WORDPRESS CACHING LAYERS (fastest → slowest)
Browser Cache
Static assets cached locally (JS, CSS, images)
Instant — no server request
CDN Cache
Cloudflare / BunnyCDN edge node near visitor
5–30ms — edge node serves response
Page Cache
Full HTML cached to disk (WP Rocket, W3TC)
10–50ms — NGINX serves HTML file directly
Object Cache
Redis / Memcached — DB query results in RAM
15–80ms — PHP runs, no DB queries
Database
MySQL / MariaDB — uncached, full query execution
80–500ms — worst case, every request hits DB
What Redis actually speeds up
Redis object caching helps most with:
- Complex queries — WooCommerce product counts, user meta lookups, complex taxonomy queries
- Repeated identical queries — if your theme queries
wp_options20 times per page, Redis returns the result from memory after the first lookup - Admin area — WordPress admin is notoriously database-heavy; Redis makes it noticeably snappier
- Sites with logged-in users — page caching does not help logged-in users; object caching does
Redis does not help with:
- Full-page caching (that is LiteSpeed Cache or W3 Total Cache's job)
- Slow PHP execution
- Large image loading times
- Poor database queries that are inherently slow (a slow query cached is still a slow query the first time)
Expected speed improvement
For a typical WordPress site with standard plugins:
- Low-traffic brochure site: 10–20% improvement in TTFB (database queries are rarely the bottleneck)
- WooCommerce store (50+ products, filters): 30–50% improvement in database-heavy pages
- High-traffic WordPress (10,000+ visits/day): Significant reduction in database load, preventing crashes at traffic spikes
- Heavily customised WordPress with many plugins: Most likely to benefit — more plugins = more redundant queries
Setting up Redis on a VPS (Ubuntu)
Redis is not available on standard shared hosting. You need VPS or above.
Install Redis:
sudo apt update
sudo apt install -y redis-server
sudo systemctl enable redis
sudo systemctl start redis
# Verify it is running
redis-cli ping # should return PONG
Configure Redis for production:
sudo nano /etc/redis/redis.conf
Key settings:
maxmemory 256mb # limit Redis memory usage
maxmemory-policy allkeys-lru # evict least-recently-used keys when full
bind 127.0.0.1 # only accept local connections (do not expose to internet)
requirepass yourpassword # set a password
Restart Redis:
sudo systemctl restart redis
Connecting WordPress to Redis
Install the Redis Object Cache plugin:
- Plugins → Add New → search "Redis Object Cache" (by Till Krüss)
- Install and activate
Configure wp-config.php:
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_PASSWORD', 'yourpassword');
define('WP_REDIS_DATABASE', 0);
Enable the cache: In WordPress Admin → Settings → Redis → Enable Object Cache
You will see a green "Connected" status and cache hit/miss ratio.
What cache hit ratio means
The plugin dashboard shows a hit ratio. Interpretation:
- Hit ratio > 80%: Excellent — Redis is serving most requests from cache
- Hit ratio 50–80%: Good — significant benefit
- Hit ratio < 50%: Marginal — your cache may be too small or your content is highly dynamic
If the hit ratio is low, check:
- The
maxmemorysetting — if Redis runs out of memory, it evicts cache entries - Your cache key prefix (if multiple WordPress sites share the same Redis instance, configure unique prefixes)
Redis on shared hosting (server-side)
Some managed WordPress and higher-tier shared hosting plans include Redis. Check your hosting plan:
- If Redis is available, your host will provide connection details
- Set the credentials in wp-config.php as above
- No server-level configuration needed on shared hosting
VillageHosting VPS plans can be configured with Redis on request. Our managed plans include Redis setup as part of onboarding.
Redis vs Memcached
Both provide persistent object caching for WordPress. Practical differences:
| Redis | Memcached | |
|---|---|---|
| Data structures | Rich (strings, hashes, lists, sets) | Strings only |
| Persistence | Optional disk persistence | Memory only |
| Cluster support | Built-in | Third-party |
| WordPress plugins | Redis Object Cache | W3 Total Cache |
| Typical choice | Default for new setups | Legacy environments |
For WordPress object caching, either works. Redis is preferred because it has better tooling and the Redis Object Cache plugin is actively maintained.
Combining Redis with page caching
Redis object caching and page caching (LiteSpeed Cache, WP Rocket, W3 Total Cache) are complementary — not competing:
- Page caching serves cached full HTML pages to anonymous users, bypassing PHP and the database entirely
- Redis object caching speeds up database queries for requests that do hit PHP (logged-in users, dynamic pages, admin)
Use both for maximum performance:
- LiteSpeed Cache for full-page caching
- Redis for object caching
With LiteSpeed Cache on VillageHosting's LiteSpeed servers, combined with Redis, TTFB for cached pages is typically under 50ms.
Monitoring Redis performance
# Real-time Redis statistics
redis-cli monitor # shows all commands — use carefully on production
# Memory usage
redis-cli info memory | grep used_memory_human
# Hit/miss ratio
redis-cli info stats | grep keyspace
Or use the Redis Object Cache plugin's built-in dashboard for a visual overview.