What is Gzip Compression?
Gzip compression can easily be enabled on rails using Rack Deflater.
Rack Deflater Rybydoc: https://www.rubydoc.info/gems/rack/Rack/Deflater
To enable it, just open config/application.rb and add the following.
#File: config/application.rb require_relative "boot" require "rails/all" Bundler.require(*Rails.groups) module Myapp class Application < Rails::Application config.load_defaults 6.1 config.middleware.use Rack::Deflater end end
config.middleware.use Rack::Deflater will enable rack deflater
Your app will now compress all static assets and serve them. You should now see an improvement in loading times of your application. That’s all folks, have a nice day.