How do I gzip webpage output with Rails?

wusher picture wusher · Oct 30, 2008 · Viewed 8.3k times · Source

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

Edit: The company I am hosting with has stated they will not install mod_deflate.

Answer

Otto picture Otto · Oct 30, 2008

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