tillkruss/redis-cache
A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
Maintainers
Package info
github.com/rhubarbgroup/redis-cache
Type:wordpress-plugin
pkg:composer/tillkruss/redis-cache
Requires
- php: ^7.2 || ^8.0
- colinmollenhour/credis: ^1.12.1
- composer/installers: ~1.0 || ~2.0
- mnsami/composer-custom-directory-installer: ^2.0
- predis/predis: ^1.1 || ^2.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.2.0
- dms/phpunit-arraysubset-asserts: ^0.5.0
- php-stubs/wp-cli-stubs: ^2.7
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
- squizlabs/php_codesniffer: ^3.7
- szepeviktor/phpstan-wordpress: ^1.1
- wp-coding-standards/wpcs: ^3.3
- yoast/wp-test-utils: ^1.0
Suggests
- ext-redis: Required to use PhpRedis as the object cache backend.
- ext-relay: Required to use Relay as the object cache backend.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-06-09 18:18:07 UTC
README
A persistent object cache backend powered by Redis®¹. Supports Predis, PhpRedis (PECL), Relay, replication, sentinels, clustering and WP-CLI.
👁 Redis Object Cache screenshots
Object Cache Pro
A business class Redis®¹ object cache backend. Truly reliable, highly optimized, fully customizable and with a dedicated engineer when you most need it.
- Rewritten for raw performance
- 100% WordPress API compliant
- Faster serialization and compression
- Easy debugging & logging
- Cache prefetching and advanced analytics
- Fully unit tested (100% code coverage)
- Optimized for WooCommerce, Jetpack & Yoast SEO
- And much more...
Installation
To get started, please see the installation instructions.
FAQ & Troubleshooting
Answers to common questions and troubleshooting of common errors can be found in the FAQ.
Configuration
The Redis Object Cache plugin comes with vast set of configuration options. If you're unsure how to use them read the installation instructions.
| Configuration constant | Default | Description |
|---|---|---|
WP_REDIS_HOST |
127.0.0.1 |
The hostname of the Redis server |
WP_REDIS_PORT |
6379 |
The port of the Redis server |
WP_REDIS_PATH |
The path to the unix socket of the Redis server | |
WP_REDIS_SCHEME |
tcp |
The scheme used to connect: tcp or unix |
WP_REDIS_DATABASE |
0 |
The database used by the cache: 0-15 |
WP_REDIS_PREFIX |
The prefix used for all cache keys to avoid data collisions (replaces WP_CACHE_KEY_SALT), should be human readable and not a "salt" |
|
WP_REDIS_PASSWORD |
The password of the Redis server, supports Redis ACLs arrays: ['user', 'password'] |
|
WP_REDIS_MAXTTL |
0 |
The maximum time-to-live of cache keys |
WP_REDIS_CLIENT |
The client used to communicate with Redis (defaults to phpredis when installed, otherwise predis), supports phpredis, predis, relay |
|
WP_REDIS_TIMEOUT |
1 |
The connection timeout in seconds |
WP_REDIS_READ_TIMEOUT |
1 |
The timeout in seconds when reading/writing |
WP_REDIS_IGNORED_GROUPS |
[] |
Groups that should not be cached between requests in Redis (read more) |
Connections
Scaling
Redis Object Cache offers various replication, sharding, cluster and sentinel setups to users with advanced technical knowledge of Redis and PHP, that have consulted the Predis, PhpRedis or Relay documentation.
WP CLI commands
Redis Object Cache has various WP CLI commands, for more information run wp help redis.
| Command | Description |
|---|---|
wp redis status |
Shows the object cache status and diagnostics |
wp redis enable |
Enables the object cache |
wp redis disable |
Disables the object cache |
wp redis update-dropin |
Updates the object cache drop-in |
Actions & Filters
Redis Object Cache has various hooks and the commonly used ones are listed below.
| Filter / Action | Description |
|---|---|
redis_cache_expiration |
Filters the cache expiration for individual keys |
redis_cache_validate_dropin |
Filters whether the drop-in is valid |
redis_cache_add_non_persistent_groups |
Filters the groups to be marked as non persistent |
redis_cache_manager_capability |
Filters the capability a user needs to manage the plugin |
Footnotes
¹ Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Redis Object Cache is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Redis Object Cache.
