Repository navigation
Installation
Ace Redis Cache installs like any plugin. It does nothing until you connect it to Redis and switch it on, so you can install it on a live site and set it up at your own pace.
The plugin:
- starts with caching off on a fresh install;
- writes its two drop-ins only when you turn on the cache they belong to;
- never overwrites a drop-in it did not write;
- sends nothing anywhere except the Redis server you give it.
You need the PHP Redis extension and a Redis or Valkey server. Check both first: Requirements and hosting.
php -m | grep -i redis
redis-cli -h 127.0.0.1 -p 6379 ping
The first should print redis, the second PONG. Without the extension the plugin loads but caches nothing.
Clone the repository into your plugins folder:
git clone https://github.com/AceMedia/Ace-Redis-Cache.git wp-content/plugins/ace-redis-cache
Or upload a release zip under Plugins > Add New > Upload Plugin.
Activate it. On multisite, network activate it if you want one set of settings for the whole network (see Multisite).
Open Settings > Ace Redis Cache. On a network it is under Network Admin > Settings.
On the Connection tab:
| Field | What to enter |
|---|---|
| Redis Host | Host name or IP address. 127.0.0.1 for a Redis on the same machine. |
| Redis Port |
6379 unless your server says otherwise. |
| Password | The AUTH password, or empty. |
| TLS Encryption | Tick it for a server that requires TLS, which most managed services do. |
Save, then open the Diagnostics tab and run the connection test. Fix the connection before going further: every other step depends on it.
Back on the Connection tab, tick Enable Cache and save.
On the Caching tab choose what to cache:
| Switch | What it does | Drop-in it installs |
|---|---|---|
| Page Cache | Stores whole pages for guests | advanced-cache.php |
| Object Cache | Stores WordPress's object cache in Redis | none on its own |
| Transient Cache | Sends transients to Redis through the object cache drop-in | object-cache.php |
For a full setup, turn on all three.
Add this to wp-config.php, above the line that says to stop editing:
define( 'WP_CACHE', true );
Without it WordPress never loads advanced-cache.php. The Diagnostics tab tells you if it is missing.
By default a cached page is served by the plugin, after WordPress has loaded. To have the drop-in answer hits before WordPress loads at all, add:
define( 'ACEREDIS_EARLY_SERVE', true );
Until you do, the drop-in only reports what it would have done, in the X-Ace-Early response header ending ; dark-launch. That lets you confirm it finds your pages before you rely on it. See Page cache.
If the site does not use Redis database 0, or the drop-ins should use an address other than 127.0.0.1:6379, set the connection constants too:
define( 'ACEREDIS_HOST', 'redis.internal' );
define( 'ACEREDIS_PORT', 6379 );
define( 'ACEREDIS_DB', 3 );
Signed out, request the same page twice:
curl -sI https://example.com/ | grep -i x-ace
The first response says X-AceRedisCache: MISS. A later one says HIT, or HIT (advcache) when early serve is on.
With Transient Cache off, the very first view of a path is rendered but not stored, so the HIT arrives on the third request, not the second. That is deliberate: the second render is the one kept.
If it stays on MISS, go to Troubleshooting.
If your wp-content is built from a repository on each deploy, the drop-ins the plugin wrote will not be in the new release. Copy both as a deploy step:
cp wp-content/plugins/ace-redis-cache/assets/dropins/object-cache.php wp-content/object-cache.php
cp wp-content/plugins/ace-redis-cache/assets/dropins/advanced-cache.php wp-content/advanced-cache.php
Do the same after every plugin update, so the drop-ins never fall behind the plugin. See Drop-ins.
Update the plugin as usual. The next time an administrator loads a wp-admin page, the plugin replaces its own drop-ins with the new versions. Cached pages and objects already in Redis are kept unless the release notes say a key format changed.
- Untick Enable Cache and the cache types, and save. The plugin removes the drop-ins it owns.
- Remove
WP_CACHEand anyACEREDIS_*constants fromwp-config.php. - Deactivate and delete the plugin. Deactivating clears the cache; deleting removes the settings.
Check that wp-content/object-cache.php and wp-content/advanced-cache.php are gone afterwards. If either is still there and carries the Ace Redis Cache name in its header, delete it by hand.
Ace Redis Cache: a page cache and object cache for WordPress, backed by Redis or Valkey. Written and maintained by Shane Rounce at AceMedia. Website · Repository · Issues · GPLv2 or later
Setting up
The caches
Your stack
Reference
Help
