Avatar

gzip fine with me... (General)

by Alfie ⌂, Vienna, Austria, Friday, March 06, 2009, 17:51 (5502 days ago) @ Andrew M.
edited by Alfie, Saturday, March 07, 2009, 11:25

Hi Andrew!

As Auge already pointed out, gzip is a server's issue. I'm running it on my forum's installation (1.7.6) since last May and it reduced traffic to about 15-20%.
I hope you may place a .htaccess file in the document root. Example:

# compress all variants of plain text
<FilesMatch ".(php|html|htm|css|js|txt)$"> 
  SetOutputFilter DEFLATE
</FilesMatch>

That's all you have to do (no modification of scripts) if gzip is supported by your hoster.
To check, open a new text file with following content:

<?php
  echo 'PHP info: ' . phpinfo();
?>

Save it as e.g. foo.php, upload it to your webspace, and call it through your browser.
Assuming an Apache webserver, look for Apache Environment. If the table contains a row
HTTP_ACCEPT_ENCODING | gzip, deflate
you are a winner.
Other places to look for are
Section HTTP Headers Information
Subsection HTTP Request Headers
Accept-Encoding | gzip, deflate
Subsection HTTP Response Headers
Content-Encoding | gzip
Section PHP Variables
_SERVER["HTTP_ACCEPT_ENCODING"] | gzip, deflate

Afterwards delete foo.php from your server (it may be a security issue).

If gzip is not supported, talk to your provider or modify the scripts...

Don't try to compress graphics (png, jpg, gif), since they are already compressed and any attempt doing so may reduce the traffic just a little at the cost of a lot of server's resources.

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)


Complete thread:

 RSS Feed of thread