Merge pull request #3589 from tomhughes/brotli

Enable brotli compression for assets
This commit is contained in:
Andy Allan 2022-08-03 19:51:56 +01:00 committed by GitHub
commit e08a997904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -36,6 +36,9 @@ gem "image_optim_rails"
# Use argon2 for password hashing
gem "argon2"
# Support brotli compression for assets
gem "sprockets-exporters_pack"
# Load rails plugins
gem "actionpack-page_caching", ">= 1.2.0"
gem "activerecord-import"

View file

@ -125,6 +125,7 @@ GEM
actionpack (>= 5.2)
activemodel (>= 5.2)
brakeman (5.2.3)
brotli (0.4.0)
browser (5.3.1)
builder (3.2.4)
bzip2-ffi (1.1.0)
@ -476,6 +477,9 @@ GEM
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-exporters_pack (0.1.2)
brotli (>= 0.2.0)
sprockets (>= 4.0.0.beta3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
@ -590,6 +594,7 @@ DEPENDENCIES
selenium-webdriver
simplecov
simplecov-lcov
sprockets-exporters_pack
strong_migrations
terser
validates_email_format_of (>= 1.5.1)

View file

@ -0,0 +1,3 @@
Rails.application.config.assets.configure do |env|
env.register_exporter %w[text/* application/javascript application/json application/xml image/x-icon image/svg+xml], Sprockets::ExportersPack::BrotliExporter
end