views:

2303

answers:

4

What is the best plugin for Rails that gzips my webpage output?

I found this plugin but it's out of date and I am not sure if I should use it.

-- edit --

I am running my server in a hosted environment and mod_deflate is not an option .

-- edit 2 --

The company I am hosting with has stated they will not install mod_deflate as stated in this forum post

A: 

Have you tried enabling compression in apache via mod_deflate?

Mr. Matt
+4  A: 

Unless you are running your Rails application without another webserver (which usually isn't a great idea), you should probably look at your webserver. All major webservers have options to enable gzip. For example, for Apache, you can use mod_deflate.

Jeroen Heijmans
+4  A: 

Have you tested to see if it's already enabled? If your hosting provider uses Apache it very well could be there by default.

Run this command against your site and see if you get the Content-Encoding: gzip header.

$ curl --head -H "Accept-Encoding: gzip" http://example.com
Otto
+1  A: 

If your hosting company does not support mod_deflate it's time for a new hosting company. I think doing this in Ruby would be pretty slow and a pain in the butt.

Luke Francl