aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Photo.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-10-14 22:28:48 +0200
committerMax Kostikov <max@kostikov.co>2019-10-14 22:28:48 +0200
commit66bfc0ec642faa0ac8798300483da95666b0318f (patch)
tree5bda81040caa2492c55454b41ed11c1aad1bafc4 /Zotlabs/Module/Photo.php
parentaa330bc8c77946b076a6365f7f5c5e34a37d5997 (diff)
parent7d0e576e3b480e6f4220e1290ff50153ed26be1a (diff)
downloadvolse-hubzilla-66bfc0ec642faa0ac8798300483da95666b0318f.tar.gz
volse-hubzilla-66bfc0ec642faa0ac8798300483da95666b0318f.tar.bz2
volse-hubzilla-66bfc0ec642faa0ac8798300483da95666b0318f.zip
Merge branch 'patch-20191014' into 'dev'
Updates to zcard/profile images and other public images to account for infrastructure caches (CDN) See merge request hubzilla/core!1754
Diffstat (limited to 'Zotlabs/Module/Photo.php')
-rw-r--r--Zotlabs/Module/Photo.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 59dc709e1..162d62815 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -272,7 +272,13 @@ class Photo extends \Zotlabs\Web\Controller {
$maxage = $expires - time();
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
- header("Cache-Control: max-age=" . $maxage . $cachecontrol);
+
+ // set CDN/Infrastructure caching much lower than maxage
+ // in the event that infrastructure caching is present.
+ $smaxage = intval($maxage/12);
+
+
+ header("Cache-Control: s-maxage=' .$smaxage. '; max-age=" . $maxage . $cachecontrol);
}