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.
advanced-cache.php drop-in, etc.). See the MilliCache installation guide.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.
web group.Verify#Copied!
- Make sure you are logged out (the middleware respects MilliCache's caching rules, which skip logged-in users by default)
- Visit an Acorn route in your browser
- Reload the page
- 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.phpdrop-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