From 69a766b300ecc39a7cf01f49d473c41872e2febd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 15 Feb 2024 13:58:07 +0100 Subject: [PATCH] use browser cache for pictures (#28179) * use browser cache for pictures * test * Update phpstan.yml * Update phpstan.yml --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d1aa2537597..dd282b552c4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9207,7 +9207,11 @@ abstract class CommonObject $alt = $overwritetitle; } } - + if (empty($cache) && !empty($val['label'])) { + // label is md5 of file + // use it in url to say we want to cache this version of the file + $cache = $val['label']; + } if ($usesharelink) { if ($val['share']) { if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) {