From 5c9092bc5b3f232b881399b8a97504763b2fc08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 13 May 2025 17:15:38 +0200 Subject: [PATCH] fix: Use a more fitting cache key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Route/CachingRouter.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php index 3f60503e283..66bdacc89a8 100644 --- a/lib/private/Route/CachingRouter.php +++ b/lib/private/Route/CachingRouter.php @@ -73,11 +73,12 @@ class CachingRouter extends Router { */ public function findMatchingRoute(string $url): array { $this->eventLogger->start('cacheroute:match'); - $cachedRoutes = $this->cache->get('root:'); + $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . '#rootCollection'; + $cachedRoutes = $this->cache->get($key); if (!$cachedRoutes) { parent::loadRoutes(); $cachedRoutes = $this->serializeRouteCollection($this->root); - $this->cache->set('root:', $cachedRoutes, 3600); + $this->cache->set($key, $cachedRoutes, 3600); } $matcher = new CompiledUrlMatcher($cachedRoutes, $this->context); $this->eventLogger->start('cacheroute:url:match');