Shorter cache key for URL entries

This commit is contained in:
Joas Schilling 2016-03-14 11:05:46 +01:00
parent 5c38c1c845
commit 69cf557d0b
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class CachingRouter extends Router {
*/ */
public function generate($name, $parameters = array(), $absolute = false) { public function generate($name, $parameters = array(), $absolute = false) {
asort($parameters); asort($parameters);
$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . json_encode($parameters) . intval($absolute); $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . intval($absolute);
if ($this->cache->hasKey($key)) { if ($this->cache->hasKey($key)) {
return $this->cache->get($key); return $this->cache->get($key);
} else { } else {