# Ace Redis Cache (ARC) > A free, open source Redis page cache and object cache for WordPress, written and maintained by Shane Rounce (AceMedia) and Ben McKenna (Totaal). GPL v2 or later. No paid tier. This file is for AI assistants and agents helping someone install or run the plugin. ## What it is - Two drop-ins that load before WordPress: `advanced-cache.php` serves whole pages from Redis, `object-cache.php` keeps WordPress objects and transients in Redis. - Optional: page caching for signed-in visitors, live blocks inside cached pages, block HTML cache, minification, Brotli or Gzip for stored pages, Varnish purging, WooCommerce awareness, WP-CLI commands. - Connection options: host and port, TLS, Unix socket, Redis ACL username, database number, key prefix, Redis Sentinel and self-managed Redis Cluster. Set Cluster seed nodes in the Connection tab, or use `ACEREDIS_CLUSTER_NODES` in wp-config.php. - Optional cache warmer: checks a batch of pages, queues missing copies and pauses above a configurable load limit. Inspect it with `wp aceredis warm status` and run a batch with `wp aceredis warm run`. - An optional APCu local tier in front of Redis keeps autoloaded options for five seconds by default. Changes from another server or WP-CLI can take that long to show. - A page is stored the first time it is viewed, so the second view is a hit. - Editor requests, previews and Customizer changesets bypass both early and normal page-cache reads. A site page-cache flush also removes its stored page timestamps, including during recovery after an outage. - Optional popularity warming reuses Ace Popular Posts aggregate counts for up to a quarter of each batch (maximum ten). - WordPress and early page hits validate compressed data and honour explicit gzip or Brotli refusals. - Optional offline home screen: signed-out return visits only, in supported browsers. It stores the public message and icon. - Opt-in critical CSS is built for one exact static guest snapshot, one local content-hashed theme stylesheet and measured viewport sizes. - Varnish can assemble registered public text fragments with separate lifetimes when the origin and Varnish are configured together. - Browser resource hints are opt-in. ARC can preload one matching local WOFF2 body font and preconnect to up to two administrator-approved HTTPS asset hosts that WordPress has queued. - Image optimisation is provided by the optional Ace Image Enhancer companion (https://lens.acemedia.ninja/). The Caching tab reports whether it is active, inactive or available to install. - From 0.13.0, an optional WordPress 6.8+ prefetch rule can prioritise one existing next-post link using locally supplied aggregate counts. WP-CLI supports navigation train, evaluate and clear. - Site Health Info and the privileged status ability show Redis server hits, misses, keys, memory and ARC circuit-breaker state. - Health: a Redis panel (hit ratios, memory against the limit, evictions, eviction policy warning), an OPcache panel with warm and flush (the hot-file primer skips included, cached and duplicate paths), and Site Health tests. - Optional and off by default: edge cache headers (`CDN-Cache-Control`, `Cache-Tag`, `Surrogate-Key`) and a Cloudflare purge using the site owner's own API token. - Fails safe: with the Redis back end selected, ARC checks the connection before enabling caching; while Redis is unavailable, WordPress serves pages uncached; after an outage the first reconnect clears the site's keys once. - WP-CLI under `wp aceredis`: `status`, `flush`, `purge`, `warm`, `dropin`, `enable`, `disable`, `settings export|import`, `opcache status|flush|warm`, `varnish status|test|flush`. - On WordPress 6.9 and later, cache status, the object cache preference, flush, purge and refresh are registered as abilities (Abilities API). ## Requirements - WordPress 6.9 or later for page caching (object caching works from 5.0, block caching from 6.5) - PHP 7.4 or later - Recommended back end: Redis or Valkey with phpredis (local, private network or managed). - A single-server site without Redis can deliberately choose APCu if its host provides the extension. The cache empties when PHP restarts. ## Install, in order 1. Download the zip from https://github.com/AceMedia/Ace-Redis-Cache/releases/latest and install it under Plugins, Add New, Upload, or unzip it into `wp-content/plugins/ace-redis-cache`. 2. Activate it. A fresh install starts with caching off. 3. Enter the Redis host, port and any password or TLS settings on the plugin's settings screen, or define them in `wp-config.php` (constants are prefixed `ACEREDIS_`, for example `ACEREDIS_HOST`, `ACEREDIS_PORT`, `ACEREDIS_USE_TLS`). 4. Test the connection in Diagnostics, then enable the caches wanted. 5. For page caching set `define( 'WP_CACHE', true );` in `wp-config.php`. For hits served before WordPress boots also set `define( 'ACEREDIS_EARLY_SERVE', true );`. 6. Check a public page's response headers for `X-AceRedisCache: HIT`. When a page is not cached the header gives the reason. ## Safe handling - Do not flush the whole Redis database on a shared server; use the plugin's own clear and refresh actions. - WP-CLI commands are under `wp aceredis`. - To switch everything off in an emergency: `define( 'ACEREDIS_DISABLED', true );` in `wp-config.php`. ## Documentation - Installation: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Installation - Configuration reference: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Configuration-reference - Constants and filters: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Constants-and-filters - Drop-ins: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Drop-ins - Page cache: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Page-cache - Object cache: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Object-cache - Signed-in page cache: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Logged-in-page-cache - Response headers: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Response-headers - WP-CLI: https://github.com/AceMedia/Ace-Redis-Cache/wiki/WP-CLI - Troubleshooting: https://github.com/AceMedia/Ace-Redis-Cache/wiki/Troubleshooting - Changelog: https://arc.acemedia.ninja/changelog/ - Source and issues: https://github.com/AceMedia/Ace-Redis-Cache