*/ array_push($cssFiles, "./css/font.css" , "./css/normalize.css" , "./vendor/bootstrap/css/bootstrap.min.css" , "./vendor/icofont/icofont.min.css" , "./vendor/boxicons/css/boxicons.min.css" , "./vendor/venobox/venobox.css" , "./vendor/owl.carousel/assets/owl.carousel.min.css" , "./vendor/aos/aos.css" , "./css/style.css" ); $buffer = ""; foreach ($cssFiles as $cssFile) { $buffer .= file_get_contents($cssFile); } // Remove comments $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); // Remove space after colons $buffer = str_replace(': ', ':', $buffer); // Remove whitespace $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); // Enable GZip encoding. ob_start("ob_gzhandler"); // Cache for 1 year $offset = 60 * 60 * 24 * 365; // Enable caching header('Cache-Control: max-age='.$offset.''); // Expire in one day header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); // Set the correct MIME type, because Apache won't set it for us header("Content-type: text/css"); // Write everything out echo($buffer); ?>