From: Michael Vogel Date: Wed, 25 Jul 2012 22:23:25 +0000 (+0200) Subject: network: Caching of images X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc27edb6d76765cd9b85d29a3c41f23f17c6ca41;p=friendica.git network: Caching of images --- diff --git a/include/network.php b/include/network.php index fd9999b539..0fff5c7cc9 100644 --- a/include/network.php +++ b/include/network.php @@ -823,6 +823,12 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $scaled = $mtch[1]; $i = fetch_url($scaled); + $cache = get_config('system','itemcache'); + if (($cache != '') and is_dir($cache)) { + $cachefile = $cache."/".hash("md5", $scaled); + file_put_contents($cachefile, $i); + } + // guess mimetype from headers or filename $type = guess_image_type($mtch[1],true);