You save your bandwith and speed up your site by gzipping your javascript code library and even your CSS, yes!

Basically if you slap this header on top of your CSS or JS file, it will be sent gzipped to the browser:

ob_start ("ob_gzhandler");
header("Content-type: text/javascript; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);

The Definitive Post on Gzipping your CSS

Compressing Javascript with PHP


Subscribe to comments Comment | Trackback |
Post Tags:

Browse Timeline


Comments ( 1 Comment )

Nice, looks like you have all the bases covered. You might also be interested in my CSS/PHP color extensions: CSS Colors

Patrick Fitzgerald added these pithy words on Mar 10 06 at 11:11

Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>