Magento 2.4.9 Performance Alert: Full Page Cache Hits Still Sending 'No-Store' Headers
As e-commerce experts at Shopping Mover, we constantly monitor the pulse of the Magento ecosystem, identifying critical issues that impact performance and stability. A recent GitHub issue (#41643) has surfaced a significant concern for Magento 2.4.9 users relying on the built-in Full Page Cache (FPC).
Magento 2.4.9 Performance Alert: Full Page Cache Hits Still Sending 'No-Store' Headers
The Cache Conundrum: A 'HIT' That Isn't Truly Cacheable
The core of the problem, as reported by bluefairydevelopment, lies in a peculiar behavior of Magento 2.4.9's built-in Full Page Cache. While the internal FPC mechanism correctly identifies and serves cached pages (indicated by X-Magento-Cache-Debug: HIT), the accompanying Cache-Control HTTP header remains stubbornly set to no-store, no-cache, must-revalidate, max-age=0. This is a critical deviation from expected behavior, where a cache hit should ideally be accompanied by a Cache-Control: public, max-age=... header, signaling to browsers and intermediary caches (like CDNs) that the content is indeed cacheable.
Reproducibility and Impact
This isn't an isolated incident or a conflict with custom extensions. The issue has been confirmed on a fresh Magento 2.4.9 installation, without any custom modules, and reproduced across both the stock Luma theme and the performance-optimized Hyvä theme. This broad reproducibility suggests a fundamental flaw within the core Magento FPC implementation for this specific version.
The implications for Magento merchants and developers are substantial:
- Reduced Frontend Performance: Without proper
Cache-Controlheaders, browsers are instructed not to cache pages locally. This means every subsequent visit to a previously loaded page requires a full request to the server, increasing load times for repeat visitors. - Ineffective CDN Caching: Content Delivery Networks (CDNs) rely heavily on
Cache-Controlheaders to determine what content to cache and for how long. Ano-storedirective effectively bypasses the CDN's caching capabilities for dynamic pages, forcing all traffic back to the origin server. - Increased Server Load: The inability of browsers and CDNs to cache content leads to a higher number of requests hitting the Magento application directly. This can strain server resources, especially during peak traffic, potentially leading to slower response times or even outages.
- Misleading Debugging: While
X-Magento-Cache-Debug: HITprovides a false sense of security that pages are being fully cached, the reality is that the external caching layer is being actively prevented from doing its job.
Technical Deep Dive: Where the Headers Go Astray
The issue author provided a valuable trace, pointing to the heart of the problem:
Magento\Framework\App\PageCache\Kernel::buildResponse() constructs a new Magento\Framework\App\Response\Http instance via httpFactory->create() and replays the saved headers onto it. That instance is returned from Kernel::load() up through Magento\PageCache\Model\App\FrontController\BuiltinPlugin::aroundDispatch(), but the final response sent to the browser does not reflect these headers.
This suggests that while the FPC kernel correctly prepares the response with the intended cache headers, something downstream in the Magento request lifecycle or response handling process is overriding or failing to apply these headers before the final response is sent to the client. It's a subtle but critical bug that undermines the very purpose of a full page cache.
What This Means for Magento Users
For merchants on Magento 2.4.9 utilizing the built-in FPC, this issue highlights a significant performance bottleneck that may be silently impacting their store. Developers should be aware of this behavior when debugging performance issues and consider alternative caching strategies or workarounds until a fix is officially released. While related issues like #38626 cover cache-key mismatches, this specific symptom of a confirmed HIT with incorrect Cache-Control headers is unique and warrants immediate attention.
Note: This insight is based solely on the provided GitHub issue description. Specific community discussions, proposed solutions, or official Magento responses from the comments section were not available for this analysis.