Return to Snippet

Revision: 10043
at December 4, 2008 16:11 by relaxasaurus

Initial Code
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";

Initial URL

Initial Description
Add this code to the top of the JS or CSS file in <?php ?> tags.  Change it's extension to PHP.  When linking external files in the <head> tags remember to use .php instead of .js or .css

To further decrease the file size, compress larger JS/CSS files with the YUI compressor: <a href=""></a>

Comparison: <a href=""></a>

Initial Title
Compress Javascript or CSS files in gzip

Initial Tags

Initial Language