From 7d0e576e3b480e6f4220e1290ff50153ed26be1a Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Mon, 14 Oct 2019 22:28:48 +0200 Subject: Updates to zcard/profile images and other public images to account for infrastructure caches (CDN) --- Zotlabs/Module/Photo.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module/Photo.php') 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); } -- cgit v1.2.3