X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FImages.php;h=c268916cc9b1e25f65e72d215b013c1377111fa3;hb=7026dd37db61e6672d6f9c6ac2deb5046be1c7a2;hp=dd4848606bb6c0c9a76ab18c7bb7203eb5466561;hpb=fa00a4ee32a693459c0d000576afada7523e79d1;p=friendica.git diff --git a/src/Util/Images.php b/src/Util/Images.php index dd4848606b..c268916cc9 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -1,6 +1,6 @@ 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; @@ -189,10 +216,11 @@ class Images if (!empty($photo)) { $img_str = Photo::getImageDataForPhoto($photo); } + // @todo Possibly add a check for locally stored files } if (empty($img_str)) { - $img_str = DI::httpRequest()->fetch($url, 4); + $img_str = DI::httpClient()->fetch($url, HttpClientAccept::IMAGE, 4); } if (!$img_str) {