Hash the URL before using it as cache key in Util\Images::getInfoFromURLCached
- This prevents oversized URL from stunting the database cache
This commit is contained in:
parent
361fdccdc7
commit
17d49422b4
|
@ -184,12 +184,14 @@ class Images
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = DI::cache()->get($url);
|
$cacheKey = 'getInfoFromURL:' . sha1($url);
|
||||||
|
|
||||||
|
$data = DI::cache()->get($cacheKey);
|
||||||
|
|
||||||
if (empty($data) || !is_array($data)) {
|
if (empty($data) || !is_array($data)) {
|
||||||
$data = self::getInfoFromURL($url);
|
$data = self::getInfoFromURL($url);
|
||||||
|
|
||||||
DI::cache()->set($url, $data);
|
DI::cache()->set($cacheKey, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user