TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to Improve Rails Caching with Brotli Compression

50 点作者 pawurb超过 1 年前

3 条评论

jonathanhefner超过 1 年前
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:&#x2F;&#x2F;api.rubyonrails.org&#x2F;v7.1&#x2F;classes&#x2F;ActiveSupport&#x2F;Cache&#x2F;Store.html#method-c-new" rel="nofollow noreferrer">https:&#x2F;&#x2F;api.rubyonrails.org&#x2F;v7.1&#x2F;classes&#x2F;ActiveSupport&#x2F;Cache...</a>
评论 #37497175 未加载
评论 #37483457 未加载
out_of_protocol超过 1 年前
If that compression is internal-only, i&#x27;d start looking at zstd, which is much better at both speed and compression level
评论 #37479654 未加载
评论 #37479638 未加载
miohtama超过 1 年前
Important to understand about Brotli vs. other compression is that Brotli has been pretrained with HTML&#x2F;CSS&#x2F;JS code. It efficiently compresses English text and source code, especially small files, due to its static dictionary.<p><a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;external&#x2F;font-compression-reference&#x2F;+&#x2F;2733d6c0c2d6774e4c4d7a233ad200c5a832a133&#x2F;brotli&#x2F;enc&#x2F;dictionary.h" rel="nofollow noreferrer">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;external&#x2F;font-compression-...</a><p>There are other factors that make Brotli good, but this is good to understand when dealing with web frontends.