Installation

Requirements#Copied!

Before installing, ensure you have:

Install the Package#Copied!

 1composer require millipress/acorn-millicache

This also installs MilliCache as a Composer dependency.

Important: MilliCache is a regular WordPress plugin. After Composer installs it, you still need to activate it in WordPress and configure it (Redis/ValKey connection, advanced-cache.php drop-in, etc.). See the MilliCache installation guide.
Tip: The service provider is registered automatically via Acorn's package discovery (extra.acorn.providers in composer.json). No manual provider registration is needed.

Publish the Config#Copied!

 1wp acorn vendor:publish --tag=millicache

This copies the config file to config/millicache.php in your Acorn application. The config controls whether the middleware is active and which middleware groups it attaches to.

Note: Publishing the config is optional. The package works with sensible defaults out of the box: middleware enabled, attached to the web group.

Verify#Copied!

  1. Make sure you are logged out (the middleware respects MilliCache's caching rules, which skip logged-in users by default)
  2. Visit an Acorn route in your browser
  3. Reload the page
  4. Check the response headers — you should see:
X-MilliCache-Status: HIT

If you see MISS on every request, check that:

  • MilliCache is active and its advanced-cache.php drop-in is in place
  • The route is not excluded by a MilliCache rule or condition
  • You are not logged in or sending cookies that bypass caching

Add Acorn MilliRules (Optional)#Copied!

Want route-aware conditions, redirects, header manipulation, and custom cache flags for your Acorn routes? Add Acorn MilliRules:

 1composer require millipress/acorn-millirules

Then scaffold your first rule:

 1wp acorn rules:make:rule RedirectLegacyPages

Rule classes are auto-discovered — no registration needed. See the Acorn MilliRules documentation for the full list of conditions and actions.

Next Steps#Copied!

  • Configuration — add middleware groups, disable auto-registration, or register manually
  • How It Works — understand the full request lifecycle