A Maho module that sends Cache-Control: no-store, no-cache, must-revalidate and Pragma: no-cache headers on all frontend pages. Configurable via admin.
Maho supports the browser's back-forward cache (bfcache) natively via the pageshow JavaScript event (see PR #991). This is the recommended approach: pages are served from bfcache for instant navigation, and the pageshow handler refreshes dynamic content (cart sidebar, checkout state) when the page is restored.
This module is intended for custom or legacy themes that do not implement the pageshow event (or equivalent client-side logic) and need to prevent stale dynamic content by disabling bfcache on the server side via Cache-Control: no-store.
- PHP >= 8.3
- Maho Commerce
composer require empiricompany/maho-nocacheheaderClear the cache after installation:
./maho cache:flushGo to System → Configuration → Web → Cache-Control Header and set Add Cache-Control: no-store, no-cache, must-revalidate and Pragma: no-cache headers to Yes.
The setting applies to frontend only — admin panel is not affected.
This module ships with the standard Maho CI gates:
- PHP CS Fixer (dry-run) —
composer cs - PHPStan (level 8) —
composer phpstan - Rector (dry-run) —
composer rector - PHP / XML syntax checks — automatic on CI
Run composer install and composer check to run all the gates locally before pushing.
OSL-3.0 / AFL-3.0