[.HTACCESS]GZIP compression your pages

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Why?

Pros

  • Save bandwidth
  • Users gets the page faster
Cons

  • CPU load

Put this in your .htaccess:
Code:
<IfModule mod_gzip.c>
  mod_gzip_on yes
  mod_gzip_item_include mime text/html
  mod_gzip_item_include mime text/plain
  mod_gzip_item_include mime text/css
  mod_gzip_item_include mime application/xml
  mod_gzip_item_include mime application/x-httpd-php
  mod_gzip_item_include mime image/x-generic
  mod_gzip_dechunk yes
  mod_gzip_min_http 1000
  mod_gzip_temp_dir /tmp
  mod_gzip_keep_workfiles No
  mod_gzip_minimum_file_size  1000
  mod_gzip_maximum_file_size  0
  mod_gzip_maximum_inmem_size 1000000
  mod_gzip_can_negotiate Yes
</IfModule>

This enables GZIP on html, plain text, images, xml and php

Source: http://forums.invisionpower.com/index.php?showtopic=180892
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
I haven't worked with this sort of compression much, just a question. How high would the CPU load be? Because it might get you suspended for high resource useage if its high enough.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I haven't worked with this sort of compression much, just a question. How high would the CPU load be? Because it might get you suspended for high resource useage if its high enough.

well, since there isn't a way to see how much CPU a single user uses it is hard to decide but I have used it for my forum and it have not been any problem at all.

It is only zipping the files before sending them
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
The only bad thing is that it slows down the CPU, a lot. Nice tutorial by the way.
 
Top