Repository navigation
Installation
Ace Redis Cache installs like any plugin. Caching starts switched off, so you can configure the connection before enabling it.
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;
- connects to the Redis server you configure. Optional edge integrations are described in Varnish and CDNs.
I recommend Redis. For this setup, check that the PHP Redis extension is installed and the web server can reach Redis or Valkey. Requirements and hosting.
php -m | grep -i redisredis-cli -h 127.0.0.1 -p 6379 pingThe first should print redis, the second PONG. If your single-server host has no Redis, see Hosting without Redis and choose APCu at step 2.
Clone the repository into your plugins folder:
git clone https://github.com/AceMedia/Ace-Redis-Cache.git wp-content/plugins/ace-redis-cacheOr 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. |
| Username | Only if your Redis uses access control lists and has given you a user name |
| Unix socket path | If Redis listens on a socket, its path. Used in place of the host and port. |
| Database number |
0 unless several sites share the server |
| Key prefix | Optional. Keeps the object caches of two installs on one Redis database apart. |
Save your Redis connection settings. For a cluster, enter your seeds under Redis Cluster nodes and follow the Cluster instructions.
On a single server without Redis, choose APCu under Back end, save and continue to step 3. The Redis fields do not apply.
Back on the Connection tab, tick Enable Cache and save. The plugin tests the selected back end before enabling the cache. A failed test keeps your previous settings and reports what failed. Once enabled, choose Test Connection in the sidebar to run the test again on the Diagnostics tab.
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.
The page cache drop-in runs before WordPress and cannot read the settings. If Redis is anywhere other than 127.0.0.1:6379 database 0, it needs the same details as constants. The settings screen and Site Health print the exact lines for your settings, ready to copy:
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-aceThe first response says X-AceRedisCache: MISS. The second says HIT, or HIT (advcache) when early serve is on. A page is stored the first time it is viewed.
Whenever a page is not served from the cache, the header says why. See Response headers.
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. Install them as a deploy step:
wp aceredis dropin install allOr copy both files:
cp wp-content/plugins/ace-redis-cache/assets/dropins/object-cache.php wp-content/object-cache.phpcp wp-content/plugins/ace-redis-cache/assets/dropins/advanced-cache.php wp-content/advanced-cache.phpDo the same after every plugin update, so the drop-ins never fall behind the plugin. See Drop-ins.
Update the plugin as usual. On the first request after the update, of any kind, 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.
- Deactivate the plugin. That clears the cache and removes its own
object-cache.phpandadvanced-cache.phpfromwp-content. A drop-in that belongs to something else is never touched. - Remove
WP_CACHEand anyACEREDIS_*constants fromwp-config.php. The plugin never writes to that file, so it does not remove them either. - Delete the plugin. That removes its settings.
Activating again puts the drop-ins back as your saved settings ask.
To take the cache out of the way without deactivating anything, see the emergency off switch.
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



