Explorar o código

Fix better control of cache

Laurent Destailleur %!s(int64=2) %!d(string=hai) anos
pai
achega
aabfd37458
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      htdocs/viewimage.php

+ 3 - 1
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');
 	}