You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was writing #32 I had dejavu and did some digging, and remembered that since, I believe, rack 1.6, Rack::Deflater already has the ability to not compress images. Here's the PR: rack/rack#457
So:
moduleYourAppclassApplication < Rails::Applicationconfig.middleware.useRack::Deflater,include: Rack::Mime::MIME_TYPES.select{|k,v| v =~ /text|json|javascript/}.values.uniqendend
Just wanted to point that out in case it relieves the maintainers of heroku-deflater some burden :)
The text was updated successfully, but these errors were encountered:
jjb
changed the title
Rack::Deflator already has this functionality?
Rack::Deflater already has this functionality?
Mar 11, 2017
Before serving a file from disk to a gzip-enabled client, it will look for a precompressed file in the same location that ends in ".gz". The purpose is to avoid compressing the same file each time it is requested.
So maybe heroku-deflater can be changed to leverage rack-deflater's capabilities but still serve precompiled gziped files, and be useful for non-rails rack projects.
As I was writing #32 I had dejavu and did some digging, and remembered that since, I believe, rack 1.6, Rack::Deflater already has the ability to not compress images. Here's the PR: rack/rack#457
So:
Just wanted to point that out in case it relieves the maintainers of heroku-deflater some burden :)
The text was updated successfully, but these errors were encountered: