Introduction
Acorn MilliCache bridges Acorn custom routes with MilliCache's Redis full-page caching. It provides a single Laravel middleware (StoreResponse) that captures Acorn route responses and stores them in the exact format MilliCache's advanced-cache.php drop-in expects.
Why Acorn MilliCache?#Copied!
Acorn MilliCache adds a StoreResponse middleware to your Acorn router. On a cache MISS, the middleware:
- Lets the controller (and any inner middleware like Acorn MilliRules) handle the request
- Checks MilliCache's cache decision — respecting all rules that ran during the request
- Captures the finished response (content, headers, status code)
- Tags the entry with a
route:{name}cache flag for targeted invalidation - Stores it in Redis/ValKey via MilliCache's
ResponseProcessor
On the next request, advanced-cache.php serves the cached version directly — no WordPress, no Acorn/Laravel, no controller. Just Redis and PHP.
advanced-cache.php drop-in. Cache rules and conditions are managed by MilliRules and Acorn MilliRules.Prerequisites#Copied!
| Requirement | Version |
|---|---|
| PHP | >= 8.1 |
| Roots Acorn | ^4.0 or ^5.0 |
| MilliCache | ^1.2.2 |
| Acorn MilliRules | optional |
MilliCache is declared as a Composer dependency and will be installed automatically. However, it is a WordPress plugin that must be activated and configured separately. See the MilliCache installation guide for details.
1composer require millipress/acorn-millirules
Next Steps#Copied!
- Installation — install the package, publish the config, and verify caching works
- Configuration — customize middleware groups or disable auto-registration
- How It Works — understand the middleware pipeline and cache lifecycle
Ready to get started? Continue to the Installation guide.