Skip to content

Enable Gzip compression by default #7327

wants to merge 7 commits into from

6 participants


Because I was wondering why Rails doesn't enable Gzip compression by default, I added it in the template, the same way I'll do it in my apps.

There may be a good reason of not enabling Gzip compression by default. If so I'd like to hear it of course ;)


I don't understand why Github display all my commits, but this pull request applies to commit 'd49f4a7'

Ruby on Rails member

Because it is usually easier and faster to do it in your webserver! If we are adding this line, I would leave it commented. But let's see what others will talk about it.


What do you exactly mean with 'easily and faster'?

I find it more easy to add it in my then editing my webserver (in my case Apache) config, since I'm not an expert in Apache.
And do you mean with 'faster' that the webserver performes better when you set the configuration in your webserver instead of in your Rails app. If so, I can imagine that you don't want to turn it on by default using your

Ruby on Rails member

Yeah, this is really a webserver thing. I'm not 👎, but I'm not 👍 either.

Ruby on Rails member

Actually, isn't Rack::Deflater another middleware? I think I am 👎 on this, we have so many middleware already.

Ruby on Rails member

Recently I found this useful in an app hosted in Heroku Cedar stack, is a 👍 in my side but please leave it commented


In addition to the idea of @guilleiguaran I commented it out by default

Ruby on Rails member
drogus commented Aug 12, 2012

Frankly, I'm not a big fan of such comments - generators could be full of things that people may need. If you turn compression on you should have an idea what you're doing and if you know what you're doing you will not have too much problems with finding the solution if you don't have access to web server.

That said, if others think that it might be useful, it certainly should go as a comment, not something that is turned on by default.

ekampp commented Aug 14, 2012

I think that the second, you really need something like this, your application is large enough that you need to put it behind some server-front (e.g. nginx or varnish) that can do the deflation for you.

IMHO rails should focus on being good at the MVC stack (just like integrated support for prototype was dropped)


@ekampp I think you're right. Rails should focus on being an MVC.

Enabling Gzip was an idea, but I think we now have enough arguments to not implement it ;)

IMO feature closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.