Rack::Deflater apparently gzip page but it appears as gibberish in browser
Asked Answered
C

1

1

I've deployed a rails 3.1 app on the new cedar stack on heroku. The new stack doesn't automatically provide gzipping so I've added

use Rack::Deflater in my config.ru

Testing it through curl with the following command:

curl -i -H 'Accept-Encoding: gzip,deflate' http://carbuzz-production.herokuapp.com

Returns an header with content encoding gzip and a body that seems compressed. Opening the page in firefox or chrome shows the body untranslated (lots of gibberish).

Any idea how to solve this?

Chemurgy answered 16/11, 2011 at 13:43 Comment(0)
C
1

This was a bit silly. Apparently rails 3.1 automatically uses Rack::Deflater so I was basically gzipping twice...

I discovered it by executing rake middleware.

I hope it helps anyway.

Chemurgy answered 16/11, 2011 at 16:25 Comment(2)
This doesn't seem to be the case with Rails 3.2 on Heroku Cedar, I'm not getting gzipped output by default.Lindane
I'm not getting gzipped output either with config.serve_static_assets = falseScissile

© 2022 - 2024 — McMap. All rights reserved.