diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 59fdfde41d0..2449960f001 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -132,10 +132,10 @@ $original_file = str_replace("../", "/", $original_file); $cachestring = GETPOST("cache", 'aZ09'); // May be 1, or an int (delay in second of the cache if < 999999, or a timestamp), or a hash if ($cachestring || image_format_supported($original_file) >= 0) { // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. - $delaycache = GETPOSTINT('cachedelay') ? GETPOSTINT('cachedelay') : ((is_numeric($cachestring) && (int) $cachestring > 1 && (int) $cachestring < 999999) ? $cachestring : '3600'); - header('Cache-Control: max-age='.$delaycache.', public, must-revalidate'); + $cachedelay = GETPOSTINT('cachedelay') ? GETPOSTINT('cachedelay') : ((is_numeric($cachestring) && (int) $cachestring > 1 && (int) $cachestring < 999999) ? $cachestring : '3600'); + header('Cache-Control: max-age='.$cachedelay.', public, must-revalidate'); header('Pragma: cache'); // This is to avoid having Pragma: no-cache - header('Expires: '.gmdate('D, d M Y H:i:s', time() + (int) $delaycache).' GMT'); // This is to avoid to have Expires set by proxy or web server + header('Expires: '.gmdate('D, d M Y H:i:s', time() + (int) $cachedelay).' GMT'); // This is to avoid to have Expires set by proxy or web server } $refname = basename(dirname($original_file)."/");