Upcoming in Rails 7.1, you can specify a custom compressor for your cache, out of the box. See the `:compressor` option of `ActiveSupport::Cache::Store.new`:<p><a href="https://api.rubyonrails.org/v7.1/classes/ActiveSupport/Cache/Store.html#method-c-new" rel="nofollow noreferrer">https://api.rubyonrails.org/v7.1/classes/ActiveSupport/Cache...</a>
Important to understand about Brotli vs. other compression is that Brotli has been pretrained with HTML/CSS/JS code. It efficiently compresses English text and source code, especially small files, due to its static dictionary.<p><a href="https://chromium.googlesource.com/external/font-compression-reference/+/2733d6c0c2d6774e4c4d7a233ad200c5a832a133/brotli/enc/dictionary.h" rel="nofollow noreferrer">https://chromium.googlesource.com/external/font-compression-...</a><p>There are other factors that make Brotli good, but this is good to understand when dealing with web frontends.