Friday, April 22, 2011

Create a PHP file to compress CSS for Wordpress

Here is the code for that
?
ob_start("ob_gzhandler");
header("content-type: text/css; charset: UTF-8");
header ("expires: " . gmdate ("D, d M Y H:i:s", time() + 302400) . " GMT");
header("Cache-Control: max-age=302400, public, must-revalidate", true);
echo "/*\n";
echo "*/\n";
echo file_get_contents('filename.css');
?

No comments:

Post a Comment