diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php
index 7f8f3ea7ab2612f7e33c0e24bcce3ca0dbd73f4c..23aad8ecf95acf881739bfebbe6d6cd3c7db8bf0 100644
--- a/htdocs/theme/auguria/style.css.php
+++ b/htdocs/theme/auguria/style.css.php
@@ -46,6 +46,9 @@ header('Content-type: text/css');
 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
 else header('Cache-Control: no-cache');
 
+// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
+if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
+
 if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]);	// If language was forced on URL by the main.inc.php
 $langs->load("main",0,1);
 $right=($langs->direction=='rtl'?'left':'right');
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 2bfee75ffaff0f5bc5b9217a499bc2aedcf533bb..f5472dcdb2b9e6922fd330560629f259d1faf3da 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -46,6 +46,9 @@ header('Content-type: text/css');
 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
 else header('Cache-Control: no-cache');
 
+// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
+if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
+
 if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]);	// If language was forced on URL by the main.inc.php
 $langs->load("main",0,1);
 $right=($langs->direction=='rtl'?'left':'right');
diff --git a/htdocs/theme/freelug/style.css.php b/htdocs/theme/freelug/style.css.php
index 6abe9dfbd87ed6bd7ed25e1df31bd680130d2769..64ead52deec98686a7dedba15921ef1231ff8cc1 100644
--- a/htdocs/theme/freelug/style.css.php
+++ b/htdocs/theme/freelug/style.css.php
@@ -45,6 +45,8 @@ header('Content-type: text/css');
 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
 else header('Cache-Control: no-cache');
 
+// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
+if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
 
 if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]);	// If language was forced on URL by the main.inc.php
 $langs->load("main",0,1);
diff --git a/htdocs/theme/yellow/style.css.php b/htdocs/theme/yellow/style.css.php
index 2e9cca8ae3871dabebdd83f2b8d5660fcbb17fcc..43932ec39ca7c2d63535442c23330de9e72b9a2b 100644
--- a/htdocs/theme/yellow/style.css.php
+++ b/htdocs/theme/yellow/style.css.php
@@ -45,6 +45,8 @@ header('Content-type: text/css');
 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
 else header('Cache-Control: no-cache');
 
+// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
+if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
 
 if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]);	// If language was forced on URL by the main.inc.php
 $langs->load("main",0,1);