在 heroku 上启用 gzip 压缩,但不要对图像进行压缩。
A simple rack middleware that enables compressing of your sprockets and webpacker assets and application responses on Heroku, while not wasting CPU cycles on pointlessly compressing images and other binary responses.
It also includes code from https://github.com/mattolson/heroku_rails_deflate
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.
Add to your Gemfile:
gem 'heroku-deflater', :group => :production
Copyright (c) 2012 Roman Shterenzon. See LICENSE.txt for further details.
暂无开放 Issues,或尚未同步最近议题。