From aabfd37458d7a7b387d3fc7b5f12e6978054f62e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 May 2023 22:33:20 +0200 Subject: [PATCH] Fix better control of cache --- htdocs/viewimage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 8cd37f2e96f..c531dbc09e0 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -157,7 +157,9 @@ if (GETPOST("cache", 'alpha')) { // Add param cache=abcdef if (empty($dolibarr_nocache)) { header('Cache-Control: max-age=3600, public, must-revalidate'); - header('Pragma: cache'); // This is to avoid having Pragma: no-cache + header('Pragma: cache'); // This is to avoid to have Pragma: no-cache set by proxy or web server + header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT'); // This is to avoid to have Expires set by proxy or web server + //header('Expires: '.strtotime('+1 hour'); } else { header('Cache-Control: no-cache'); }