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');