Pre-Compress Assets With Brotli

Generate .br files that servers can send directly.

LinuxnetworkcompressconvertLow risk
Run brotli -q 11 -k index.html to produce index.html.br at maximum quality.

01Command

Command
$ brotli -q 11 -k index.html

02What it does

Brotli is the compression algorithm used by modern web servers and CDNs, and pre-compressing static assets at build time avoids doing it on every request. The high quality levels are slow but produce noticeably smaller files than gzip for text assets.

03Risk

RiskLow risk
Requirementssudo apt install brotli
!Warning: Very high quality levels are slow; reserve -q 11 for static build steps and use lower levels for on-the-fly compression.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-10-13 · Category: Developer

06Related solutions