mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-30 16:29:26 -07:00
We can save 10 kB of binary size by compressing the frontend using brotli on max settings instead of gzip. Any browser beyond 2017 will be able to handle this, and since the Tailwind upgrade we already require browsers from 2024. (see also #903) Also we can stop using whatever gzlip cli is on the system, node has some stuff builtin. Source for the claim we require chrome 2023/firefox 2024 baseline right now: https://tailwindcss.com/docs/compatibility Compression comparison: | codec | size (bytes) | vs gzip -9 | wire format | `Content-Encoding` | |---|---:|---:|---|---| | (uncompressed) | 171,833 | +210.6% | — | — | | gzip -9 | 55,313 | — | gzip | `gzip` | | pigz -9 | 55,436 | +0.2% | gzip | `gzip` | | brotli q=4 | 55,085 | -0.4% | brotli | `br` | | brotli q=6 | 51,518 | -6.9% | brotli | `br` | | brotli q=9 | 51,243 | -7.4% | brotli | `br` | | **pigz -11** (zopfli) | **53,340** | **-3.6%** (~2 KB) | **gzip** | `gzip` | | **brotli q=11** | **47,712** | **-13.7%** (~7.4 KB) | **brotli** | `br` |