cancel
Showing results for 
Search instead for 
Did you mean: 

Google Page Insight-Compressing with gzip or deflate- How do I use this with BT hosting?

offbyheart
Member

Hi,

I have a domain with BT Advanced Hosting.  

The Google bots have analysed the pages and come up with various ways to improve the performance of the site. One of the suggestions is "Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.".

I have had a look at this and it looks as though you need to alter the .htaccess file on the server- Would anyone know how the bt advanced webhosting deals with these kind of compression issues- whether it is possible to use either?

I would be very grateful if anyone had any input on this,

Thank you in advance.

5 REPLIES 5

dave_mal
Member

I have the same problem. It took me ages to contact the right department in BT. They have now informed me that Mod_deflate is enabled on the servers. However, they will not give me advice or help on what code to put into my .htaccess file. I have tried all the possible permutations I can think of but nothing works. Can anyone help me.

 

Code I have tried (and many permutations) is:

 

# Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain</IfModule>

 

berks_103
Member

I am facing exactly the same issue. I'd like to enable compression as well and have tried various modifications to .htaccess file but none appears to enable compression.

 

Have anyone had any success with this?

LordDave
Member

Make the page PHP and add <? ob_start("ob_gzhandler"); ?> to the very first line, enjoy.

 

Lord Dave of KingdomLords 🙂

S1m0nL
Member

LordDave is right, at least for your .html/.php files you can add the following code to the top of you page and it will compress those:

 

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

 

But, it's not ideal because .js and .css files still aren't compressed.

 

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.

 

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

What do your pages contain which make them so large they need compressing?