While above answers cover all the required aspects of the response compression I would like to highlight a compression gem for performance gain .I wonder no one is talking about Brotli gem. which is more efficient than Gzip in both compression speed and file size reduction. I could have written more about it but here is a great article discussing both.