phpro / mage2-module-bypass-page-cache
Bypass the page cache by adding a specific header to the request
Installs: 23 369
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 2
Open Issues: 1
Type:magento2-module
Requires
- php: ^7.0 || ^8.0
- magento/framework: ^100.1.10|^101.0.1|^102.0|^103.0
- magento/module-page-cache: ^100.1.5
Requires (Dev)
- magento/marketplace-eqp: ^1.0
- phpro/grumphp: ^0.13
This package is auto-updated.
Last update: 2024-10-12 14:41:44 UTC
README
Bypass Page Cache for Magento 2
In some cases we want to be able to bypass Magento's full page cache. For example, when profiling a page using Blackfire, we want to test the performance of the page without full page cache.
Installation
composer require phpro/mage2-module-bypass-page-cache
Key features
Configuration
To use this feature, you have to activate it in the backend
Stores > Configuration > Advanced > System > Full Page Cache > Enable Full Page Cache Bypass
This setting is only available when you use the Built-in Cache. This feature is not relevant when you use Varnish.
Note: this is meant to be used on development and staging environments. Make sure this is disabled in production.
Blackfire
This module was built to be used with Blackfire.
When creating profiles in Blackfire, you need to be able to bypass the full page cache. Magento 2 does not provide an easy way to bypass the full page cache, so we created this module.
Blackfire adds the header X-Blackfire-Query
when profiling over HTTP. When this header exists your request, the full
page cache will be ignored.
Custom header
The module is created to work with the Blackfire header by default. If you want to use this feature, but need a different header, you can override the default configuration.
Add the following in the file config.xml
of a project module.
<default>
<system>
<full_page_cache>
<bypass_header>My-Custom-Header</bypass_header>
</full_page_cache>
</system>
</default>