Skip to content

Installation

Shane Rounce edited this page Nov 30, 2026 · 7 revisions

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.

Before you start

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 redis
redis-cli -h 127.0.0.1 -p 6379 ping

The 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.

1. Install the plugin

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).

2. Connect to Redis

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.

The Connection tab of the settings screen

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.

3. Switch it on

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.

The Diagnostics tab after a passed connection test

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.

The Caching tab with the page cache, object cache and transient cache switched on

4. Tell WordPress to load the page cache

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.

5. Optional: serve hits before WordPress boots

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 );

6. Check it works

Signed out, request the same page twice:

curl -sI https://example.com/ | grep -i x-ace

The 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.

Deploying from version control

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 all

Or copy both files:

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.

Updating

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.

Removing it

  1. Deactivate the plugin. That clears the cache and removes its own object-cache.php and advanced-cache.php from wp-content. A drop-in that belongs to something else is never touched.
  2. Remove WP_CACHE and any ACEREDIS_* constants from wp-config.php. The plugin never writes to that file, so it does not remove them either.
  3. 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.

Clone this wiki locally