Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rails 5 v2 #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Support rails 5 v2 #25

wants to merge 3 commits into from

Conversation

digerata
Copy link

@digerata digerata commented Feb 9, 2017

This is a copy of @st0012's PR #24. It just brings back the use of .try as recommended by @dcosson.

@david-a-wheeler
Copy link

An alternative to using heroku_rails_deflate is to enable deflate in Rack. If you're using Rails, you're already using Rack, and Rack now has its own built-in deflate mechanism. You just need to enable it, e.g.:

config.middleware.use Rack::Deflater

I know that Rack at one time didn't include deflate.

@digerata
Copy link
Author

digerata commented Mar 1, 2017

No kidding? That's really good to know, thanks!

@david-a-wheeler
Copy link

david-a-wheeler commented Mar 1, 2017

Sure! I just recently learned this myself, and it seems to work fine (when Amazon Web Services isn't having problems). This is a newer addition to Rack - when I originally added heroku_rails_deflate I'm pretty sure Rack didn't have this capability (or perhaps it wasn't as clearly documented).

@david-a-wheeler
Copy link

To be fair: The heroku_rails_deflate README specifically notes that it enables heroku_rails_deflate to perform its functionality. This heroku_rails_deflate gem does other (optimization) things, but since it didn't work with Rails 5, my approach was to go back-to-basics instead. You can decide what's best for your circumstance!

@david-a-wheeler
Copy link

I'd still really like to see this merged. Without heroku_rails_deflate, or something similar, we end up compressing already-compressed files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants