Like a lot of web site maker, I'm trying to accelerate the page load time ...
I'm using the 1.6.6 CMS version and try to accelerate using the Yslow firefox plugin indications.
It said me that the css were not compressed ... so I searched for solutions with google informations.
I found some solutions with htaccess modifications. I tried them, but no success according to the host apache configuration (header module not loaded ...).
So I tried to change the way the css were send. I found that in stylesheet.php, css are compressed according to the config point "output_compression". I tried to put it on true, but, no success because of apache configuration (php / html file are compress with apache so I can't add one compression level ...). So I receive a error 500 for my page.
So I tried to add code (in stylesheet.php) just before the "echo $css;", and it worked
Code: Select all
header('Etag: "'.$etag.'"');
// NEW--------------
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
{
ob_start("ob_gzhandler");
header("Content-Encoding: gzip");
}
else
{
ob_start();
}
// END NEW ---------
echo $css;
// EOF
?>
I don't really understand why it is not automatically compress with apache module :perhaps because of the request that is a text/css one and apache only compresses text/html ones.
I was thinking about the fact of adding a config point for the css like "css_output_compression".
And why not making the same for js files that could be link to a page or a template and so could have dedicated file to send them.
If someone could try this and tell me if it work on his host ....
Thanks
Stephane