heroku-deflater icon indicating copy to clipboard operation
heroku-deflater copied to clipboard

leverage Rack::Deflater's capabilities

Open jjb opened this issue 7 years ago • 0 comments

Since, I believe, rack 1.6, Rack::Deflater has the ability to not compress images. Here's the PR: https://github.com/rack/rack/pull/457

So:

module YourApp
  class Application < Rails::Application
    config.middleware.use Rack::Deflater, include: Rack::Mime::MIME_TYPES.select{|k,v| v =~ /text|json|javascript/ }.values.uniq
  end
end

Maybe this capability can be leveraged in heroku-deflater to simplify the code? (if requiring that rack version is acceptable)

jjb avatar Apr 16 '17 20:04 jjb