Merge pull request #3589 from tomhughes/brotli
Enable brotli compression for assets
This commit is contained in:
commit
e08a997904
3 changed files with 11 additions and 0 deletions
3
Gemfile
3
Gemfile
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
3
config/initializers/brotli.rb
Normal file
3
config/initializers/brotli.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue