Download the PHP package empiricompany/maho-nocacheheader without Composer
On this page you can find all versions of the php package empiricompany/maho-nocacheheader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download empiricompany/maho-nocacheheader
More information about empiricompany/maho-nocacheheader
Files in empiricompany/maho-nocacheheader
Package maho-nocacheheader
Short Description Adds Cache-Control: no-cache, private header globally on all frontend pages, restoring OpenMage default behavior. Configurable via admin.
License OSL-3.0
Informations about the package maho-nocacheheader
Maho NoCacheHeader
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.
When to use this module
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.
Requirements
- PHP >= 8.3
- Maho Commerce
Installation
Clear the cache after installation:
Configuration
Go 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.
Development
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.
License
OSL-3.0 / AFL-3.0