2

I have just enabled Rack::Deflater in my app. In the headers I can see Accept-Encoding:gzip, deflate, sdch. But PageSpeed Insights report that the gzip is not enabled! I use Nginx and Puma in the server. How can I fix this?

THpubs
  • 7,804
  • 16
  • 68
  • 143
  • Related question. We are using rails 4 and ruby 2.2. I tried to enable content compression with Rack deflater like described here(https://robots.thoughtbot.com/content-compression-with-rack-deflater). – smc Jun 04 '16 at 07:10

1 Answers1

2

I had exactly the similar problem.

When I started the suggestion here to inserting config.middleware.use Rack::Deflater in config/application.rb content was not compressed. Solutions suggested like Using config.middleware.insert_before or updating config.ru also did not work.

Then I found out that it was not because of any problem with approaches listed above, but it was because, I was using apache/httpd and I had to explicitly enable rack_deflate module as described here, and compression started working.

Community
  • 1
  • 1
smc
  • 710
  • 1
  • 9
  • 26