I've got a joomla site on the shared server consequently I dont get access to apache make it possible for gzip or defalte so im wondering things i can perform maybee with php make it possible for compression to accelerate my website?

You can test to show on output compression by setting the zlib.ouput_compression setting:

http://php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression

or particularly do output loading and run it with the GZIP handler:

ob_start("ob_gzhandler");

the very first choice is the most well-liked method, should you choose make use of the second method make sure that it does not break any ouput loading Joomla does - I am no Joomla expert however i would expect a Content management systems to supply a choice to compress content before delivery.

If gzip enabled in your host you have to add this lines to .htaccess file without improve your code


AddOutputFilterByType DEFLATE text/html text/plain text/css application/json

AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript

AddOutputFilterByType DEFLATE text/xml application/xml text/x-component

this lines allows apache deflate in html, css json and xml content

It might be nice should you add the problem to see if it accepts encoding such as this.

<?php
 if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
     ob_start("ob_gzhandler");
 else
     ob_start();
?>

Note: you'll have to do that for each php file, in case your server does not support .htaccess configuration.