From fa801ac0bdeb6fdcdf93743b383f87e0106354b5 Mon Sep 17 00:00:00 2001 From: Ryan Hoerr Date: Thu, 9 Apr 2026 14:26:11 -0400 Subject: [PATCH] Enhance cacheability check in isRequestCacheable method --- Plugin/Framework/App/Response/Http.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Plugin/Framework/App/Response/Http.php b/Plugin/Framework/App/Response/Http.php index 6d8b694..8515eb5 100644 --- a/Plugin/Framework/App/Response/Http.php +++ b/Plugin/Framework/App/Response/Http.php @@ -93,6 +93,14 @@ public function afterSetNoCacheHeaders(\Magento\Framework\App\Response\Http $sub */ private function isRequestCacheable(string $cacheControl): bool { + // FPC hits will not have public or private cache control directives -- already processed + if (!str_contains($cacheControl, 'public') + && !str_contains($cacheControl, 'private') + && !str_contains($cacheControl, 'no-store')) { + return true; + } + + // FPC misses will be cacheable if they have a public directive return (bool) preg_match('/public.*s-maxage=(\d+)/', $cacheControl); }