From 5fe18791ce907147f4a323889fd4d6c8caf3dc7d Mon Sep 17 00:00:00 2001 From: "Nicolas D." <50154923+nicolasddev@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:52:24 -0500 Subject: [PATCH] Performance Improvement According to the PHP manual; "If this parameter is a string and the pattern parameter is an array, all patterns will be replaced by that string. ". Therefore, there is no need to waste resources generating an array filled with empty values for the replacement. --- lib/internal/Magento/Framework/App/PageCache/Identifier.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/App/PageCache/Identifier.php b/lib/internal/Magento/Framework/App/PageCache/Identifier.php index b10681654683d..6c602b3f92c23 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Identifier.php +++ b/lib/internal/Magento/Framework/App/PageCache/Identifier.php @@ -51,8 +51,7 @@ public function __construct( public function getValue() { $pattern = $this->getMarketingParameterPatterns(); - $replace = array_fill(0, count($pattern), ''); - $url = preg_replace($pattern, $replace, (string)$this->request->getUriString()); + $url = preg_replace($pattern, "", (string)$this->request->getUriString()); list($baseUrl, $query) = $this->reconstructUrl($url); $data = [ $this->request->isSecure(),