Why not change the Skin Manager to save two versions of the css file:
- css_3.css, and
- css_3.php
CODE
<?php
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: iso-8859-1");
header("Cache-Control: must-revalidate");
$offset = 60 * 60;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: iso-8859-1");
header("Cache-Control: must-revalidate");
$offset = 60 * 60;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
And then, add a setting to import css_3.php instead of css_3.css (so the admin could choose whether to use the compressed version or not). You could also just tie this to the gzip setting to avoid yet another setting although maybe not all browser work with compressed CSS?
I know you could put this compression code in .htaccess and do this without changing the CSS file at all or just use mod_gzip to compress CSS files, but this seems to be a nice idea for those that don't want to bother with all this and just have an optimization setting in IPB.
For my 44KB CSS file, the compressed file is just under 8K. Not a huge savings, but still might help especially with loading the first page the user hits on the forum.
Note also that you could set the cache expiration to be longer (or shorter) than the hour in the above example. I'll probably set mine to a day or even longer.
Just a thought... I haven't tried this yet on a production board to see if any browsers still have issues with compressed CSS files.
