mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:42:53 +00:00
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
1 changed files with 4 additions and 2 deletions
|
@ -184,12 +184,14 @@ class Images
|
|||
return $data;
|
||||
}
|
||||
|
||||
$data = DI::cache()->get($url);
|
||||
$cacheKey = 'getInfoFromURL:' . sha1($url);
|
||||
|
||||
$data = DI::cache()->get($cacheKey);
|
||||
|
||||
if (empty($data) || !is_array($data)) {
|
||||
$data = self::getInfoFromURL($url);
|
||||
|
||||
DI::cache()->set($url, $data);
|
||||
DI::cache()->set($cacheKey, $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
|
Loading…
Reference in a new issue