diff --git a/vendor/magento/module-store/App/Request/StorePathInfoValidator.php b/vendor/magento/module-store/App/Request/StorePathInfoValidator.php
index abbf29fd0c9..e22742992d7 100644
--- a/vendor/magento/module-store/App/Request/StorePathInfoValidator.php
+++ b/vendor/magento/module-store/App/Request/StorePathInfoValidator.php
@@ -1,8 +1,9 @@
 <?php
 /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
+ * Copyright 2011 Adobe
+ * All Rights Reserved.
  */
+
 declare(strict_types=1);
 
 namespace Magento\Store\App\Request;
@@ -11,6 +12,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface;
 use Magento\Framework\App\Request\Http;
 use Magento\Framework\App\Request\PathInfo;
 use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
 use Magento\Store\Api\StoreRepositoryInterface;
 use Magento\Store\Model\Store;
 use Magento\Store\Model\StoreIsInactiveException;
@@ -19,7 +21,7 @@ use Magento\Store\Model\Validation\StoreCodeValidator;
 /**
  * Gets the store from the path if valid
  */
-class StorePathInfoValidator
+class StorePathInfoValidator implements ResetAfterRequestInterface
 {
     /**
      * Store Config
@@ -43,6 +45,11 @@ class StorePathInfoValidator
      */
     private $storeCodeValidator;
 
+    /**
+     * @var array
+     */
+    private array $validatedStoreCodes = [];
+
     /**
      * @param ScopeConfigInterface $config
      * @param StoreRepositoryInterface $storeRepository
@@ -79,17 +86,25 @@ class StorePathInfoValidator
             $pathInfo = $this->pathInfo->getPathInfo($request->getRequestUri(), $request->getBaseUrl());
         }
         $storeCode = $this->getStoreCode($pathInfo);
+
         if (empty($storeCode) || $storeCode === Store::ADMIN_CODE || !$this->storeCodeValidator->isValid($storeCode)) {
             return null;
         }
 
+        if (array_key_exists($storeCode, $this->validatedStoreCodes)) {
+            return $this->validatedStoreCodes[$storeCode];
+        }
+
         try {
             $this->storeRepository->getActiveStoreByCode($storeCode);
 
+            $this->validatedStoreCodes[$storeCode] = $storeCode;
             return $storeCode;
         } catch (NoSuchEntityException $e) {
+            $this->validatedStoreCodes[$storeCode] = null;
             return null;
         } catch (StoreIsInactiveException $e) {
+            $this->validatedStoreCodes[$storeCode] = null;
             return null;
         }
     }
@@ -105,4 +120,12 @@ class StorePathInfoValidator
         $pathParts = explode('/', ltrim($pathInfo, '/'), 2);
         return current($pathParts);
     }
+
+    /**
+     * @inheritDoc
+     */
+    public function _resetState(): void
+    {
+        $this->validatedStoreCodes = [];
+    }
 }
