Docs / Performance Optimization / How to Set Up WordPress Object Caching with Redis

How to Set Up WordPress Object Caching with Redis

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 26 views · 1 min read

Why Use Redis for WordPress?

WordPress executes numerous database queries on every page load. Redis stores frequently accessed data in memory, eliminating redundant database calls and reducing page load times significantly. On a Breeze, this can cut response times by 50% or more for dynamic pages.

Prerequisites

  • A Breeze running Ubuntu 22.04+ with WordPress installed
  • PHP 8.0+ with the phpredis extension
  • Root or sudo access

Step 1: Install Redis Server

sudo apt update
sudo apt install redis-server php-redis

Step 2: Configure Redis

sudo nano /etc/redis/redis.conf

Set these recommended values:

maxmemory 256mb
maxmemory-policy allkeys-lru
supervised systemd
sudo systemctl restart redis-server
sudo systemctl enable redis-server

Step 3: Install the Redis Object Cache Plugin

Install and activate the Redis Object Cache plugin from the WordPress dashboard under Plugins > Add New. Then navigate to Settings > Redis and click Enable Object Cache.

Step 4: Verify the Connection

Check Redis is accepting connections:

redis-cli ping

You should see PONG. Monitor cache activity in real time:

redis-cli monitor

Advanced Configuration

Add these constants to wp-config.php for fine-tuning:

define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_DATABASE', 0);
define('WP_REDIS_PREFIX', 'wp_');

Tips

  • Monitor memory usage with redis-cli info memory
  • Use separate Redis databases if running multiple WordPress sites on your Breeze
  • Restart PHP-FPM after installing the phpredis extension

Was this article helpful?