Faster image processing with photo cache addon

This commit is contained in:
Max Kostikov 2018-12-24 09:22:58 +01:00
parent cdb85f1309
commit 37d7d18bb7

View File

@ -159,14 +159,15 @@ class Photo extends \Zotlabs\Web\Controller {
// Validate cache
$cache = array(
'resid' => $photo,
'url' => htmlspecialchars_decode($r[0]['display_path'])
'status' => false
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
if($cache['url'] != '') {
if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false)
$cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']);
header("Location: " . $cache['url']);
if(! $cache['status']) {
$url = htmlspecialchars_decode($r[0]['display_path']);
if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false)
$url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url);
header("Location: " . $url);
killme();
}
}