From 89f24f6fe8de0c043c2a05b5bb5f736eeeec2bc9 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Fri, 4 Jan 2019 18:58:36 +0100 Subject: [PATCH] Fix cache not working on css files --- htdocs/website/index.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e4d0e8e6145..e56808f8f9e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -910,6 +910,7 @@ if ($action == 'updatecss') $csscontent.= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $csscontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $csscontent.= "ob_start();\n"; + $csscontent.= "header('Cache-Control: max-age=3600, public, must-revalidate');\n"; $csscontent.= "header('Content-type: text/css');\n"; $csscontent.= "// END PHP ?>\n"; @@ -942,6 +943,7 @@ if ($action == 'updatecss') $jscontent.= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $jscontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $jscontent.= "ob_start();\n"; + $jscontent.= "header('Cache-Control: max-age=3600, public, must-revalidate');\n"; $jscontent.= "header('Content-type: application/javascript');\n"; $jscontent.= "// END PHP ?>\n"; @@ -974,6 +976,7 @@ if ($action == 'updatecss') $robotcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $robotcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $robotcontent.= "ob_start();\n"; + $robotcontent.= "header('Cache-Control: max-age=3600, public, must-revalidate');\n"; $robotcontent.= "header('Content-type: text/css');\n"; $robotcontent.= "// END PHP ?>\n";*/ @@ -1000,20 +1003,21 @@ if ($action == 'updatecss') // Css file $htaccesscontent =''; - /*$robotcontent.= "\n";*/ + /*$htaccesscontent.= "\n";*/ $htaccesscontent.= GETPOST('WEBSITE_HTACCESS', 'none'); - /*$robotcontent.= "\n".'"."\n";*/ + /*$htaccesscontent.= "\n".'"."\n";*/ dol_syslog("Save file htaccess into ".$filehtaccess);