if you have any PHP support on a server ANYWHERE, here's a nice little script that will automatically gzip deflate js and css files if the browser supports it:
lib.php:
Code:
<?php
@ob_start('ob_gzhandler');
if(substr($_GET['src'], -3) == '.js')
$mime = 'text/javascript';
elseif(substr($_GET['src'], -4) == '.css')
$mime = 'text/css';
header('Content-type: '. $mime);
readfile($_GET['src']);
?>
What this does is it gets the file path from
$_GET['src'] and reads the file after sending appropriate headers, and compresses it along the way, thanks to the second line.
Example usage:
Code:
<script type="text/javascript" src="lib.php?src=path/to/file.js"></script>
Which compresses and outputs the contents of the file at path/to/file.js