cancel
Showing results for 
Search instead for 
Did you mean: 

.htaccess file with gzip code

orthohin
Grand Master

hi,

Using gzip code in the .htaccess file to speed up page loading does not work when using a shared server?

4 REPLIES 4

S1m0nL
Member

Getting compression working 100% with BT seems to be an impossibility.

 

If your webpages have a .php extension you can get it partially working by adding the following code to the top of you page and it will compress your .php files, at least:

 

  <?php ob_start("ob_gzhandler"); ?>

 

It's not perfectl because the .js and .css files still aren't compressed.

 

Personally, I have been round-and-round in circles on this with BT and I can't find any solution. I was told "you can't use GZip" and then "you can use DEFLATE but not GZip" and then "you can use GZip but not DEFLATE". I have tried what BT support suggested during all that, and I have also followed every credible example I can find online, including Google's advice (which is undoubtably flawless)... Nothing works... Try a different hosting company if you need it 100% -- it's pretty standard now and most hosting companies offer the ability to do this, BT are just being stubborn, that's my conclusion.

 

Not that it will help, but Google advise looking at these:

 

http://httpd.apache.org/docs/current/mod/mod_deflate.html

 

https://github.com/h5bp/server-configs

studiosoft
Member

I find it better to keep the file size of the page reasonable rather than revert to Mickey Mouse solutions. What do you have in your page which is so large it needs compressing?

charlesr
Member

Bah. This is nonsense. Gzip is standard now and Google penalises pages that aren't using it. If you don't have compression activated on your Javascript, pagespeed insights instantly wipes 20-30% off your speed score (an important part of their pagerank). I spent hours trying to figure out why it wasn't working, stupidly assuming it was something at my end and then searched and found this thread.

studiosoft
Member

I would be interested in knowing where your information came from, it is certainly incorrect.

There is no need to compress any web page and the reason why many pages take too long to load is not because they are uncompressed but becuse they contain far too much background processing.