Is there a reason Rack :: Deflater gzip is not enabled by default in Ruby on Rails?

Is there a reason Rack :: Deflater gzip is not enabled by default in Ruby on Rails? What are the disadvantages of gzip for rails, if any?

+5
source share
1 answer

I do not know the official reason for this, but most likely they do not, because there are better places to compress gzip responses. As an external proxy server or load balancer or your CDN. For example, I use AWS Elastic Beanstalk to deploy Rails applications, and I configure gzip compression on the Elastic Load Balancer (ELB), and not inside the Rails application. You want to make your application easier to compress and let it focus on its core business logic. As HTML, CSS and JS compression is a trivial task that any proxy server can do, you want to download this load from your application to your load balancer. I don’t think anyone allowed Rack middleware to do compression in production. Maybe only for very simple and small applications that work on one instance without load balancing in front. For large and complex applications, you want your proxy to handle this "work".

+1
source

Source: https://habr.com/ru/post/1261982/


All Articles