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:

  1. Lets the controller (and any inner middleware like Acorn MilliRules) handle the request
  2. Checks MilliCache's cache decision — respecting all rules that ran during the request
  3. Captures the finished response (content, headers, status code)
  4. Tags the entry with a route:{name} cache flag for targeted invalidation
  5. 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.

Note: This package only handles cache storage. Cache serving is handled by MilliCache's 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.

Tip: Pair with Acorn MilliRules for the full picture. While Acorn MilliCache handles cache storage, Acorn MilliRules lets you define route-aware conditions, HTTP response actions, redirects, header manipulation, and custom cache flags — all from auto-discovered rule classes. Caching is just the beginning.

 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.