mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix: Use a more fitting cache key
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
01575b7d95
commit
5c9092bc5b
1 changed files with 3 additions and 2 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue