Gzip Filter GemPlugin

This GemPlugin hands back HTTP responses compressed using gzip if the client requests it. It’s been tested in IE6, Mozilla Firefox 1.5 and 2.0.

Install, config, run

$ sudo gem install gzip_filter $ echo ‘uri “/”, :handler => plugin(“/handlers/gzipfilter”)’ >> config/mongrel.conf $ mongrel_rails -S config/mongrel.conf

Using with mongrel_cluster

Add the following line to your config/mongrel_cluster.yml file:

config_script: config/mongrel.conf

ChangeLog

2006/10/25 – 0.2

* Added :gzip_condition => proc{|request|} to GzipFilter's constructor.
  You can now write some Ruby code to gzip responses based on what was

given to you in the request.

Example (in mongrel.conf):
   # Gzip only for non IE6 requests
   uri "/", :handler => GzipFilter.new(:gzip_condition => proc {|request|
     request.params['HTTP_USER_AGENT'] !~ /MSIE\s+6\.0/i
   })

2006/10/23 – 0.1

* Initial release