Dont cache empty url for not found routes

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-10-18 18:20:25 +02:00
parent 64f1ad9381
commit 219905b9c8
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ class CachingRouter extends Router {
return $cachedKey;
} else {
$url = parent::generate($name, $parameters, $absolute);
$this->cache->set($key, $url, 3600);
if ($url) {
$this->cache->set($key, $url, 3600);
}
return $url;
}
}