Repository navigation
Tested at scale
Ace Redis Cache was not written as an exercise. I wrote it because the sites I look after needed it. The caching behind it has been in production for four years: three as hand-written Redis code on those sites, then as this plugin.
These are measured, not estimated. They come from the Redis servers and load balancers behind the sites running the plugin, over the periods those systems keep records for.
| Figure | What it is |
|---|---|
| More than 5.6 billion | Cache hits answered from Redis across the sites running it. The busiest site accounts for 3.1 billion of them. |
| More than 640 million | Requests served across every site running it, over the last year or so |
| 2.7 million in one hour | Requests at the peak on the busiest site: about 770 every second, for an hour |
| 20 million in four days | Requests over the busiest long weekend, Friday to Monday, on that site |
| 1 ms | Median response from the web servers across the whole of the busiest day, peak hour included |
| 0 | Evictions on that site in fifteen months. Its Redis never had to throw anything away to make room. |
I do not name those sites or say what they do. The traffic is theirs to talk about, not mine.
Each of these was a real problem on a live site before it was a line in the changelog.
| What happened | What the plugin does now |
|---|---|
| A cache flush used a command that blocks Redis while it walks every key | Nothing in the plugin uses KEYS. Flushing the object cache is one counter increment. |
| A purge after a deploy sent every visitor and crawler to a cold render at once | Soft purge: pages are marked stale, kept, and refreshed one at a time in the background |
| An importer saving hundreds of posts flushed the whole cache on every save | A save invalidates that post's own keys. Pages are refreshed in place. |
| A cluster-mode server refused a read that named several keys, silently | Every command names a single key |
| Week-long transients from other plugins crowded the working set out of a shared Redis | Every key has a maximum lifetime, a day by default |
| A half-rendered page was stored and served to everyone | Pages are checked before they are kept. Empty, private and broken renders are refused. |
| A stalled Redis held PHP workers until the site queued | Short timeouts, and the site carries on without the cache |
| A background render held the worker that asked for it | The request is handed over and the worker let go |
| Editors saving in the block editor never purged anything | Recaching runs for every save, wherever it comes from |
- In production, on sites with real visitors, real editors and real traffic spikes.
- On managed Redis services as well as a Redis on the same machine, with TLS, and on cluster-mode endpoints.
- Behind Varnish and behind CDNs.
- On shops, where a wrongly cached basket is the worst thing a cache can do.
- With automated tests in the repository for the guards that matter most: what may be stored, what a purge removes, how the drop-ins are replaced, and how the plugin behaves when a read fails.
It does not mean the plugin is finished, or that it suits every site. It has opinions: it would sooner serve a slightly stale page than send a crowd to a cold render, and it would sooner refuse to store a page than store one it is unsure about. If those are your priorities too, it should suit you.
The version number is below 1.0 because I am still changing things between releases. The changelog says what changed in each.
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
