People always forget about brotli for some reason. Although it is especially good for html and css. Yes, it is slow by default. But you can use a small compression level (1-4) and get better compression with less time. I made a small comparison:
File Sizes (bytes)
| File |
Original Size |
Brotli (q4) |
Gzip |
| data.html |
120,375 |
33,460 |
33,478 |
| data+.html |
148,268 |
37,149 |
37,285 |
| data.json |
135,224 |
33,982 |
34,279 |
| data_tailwind.html |
978,307 |
41,442 |
46,509 |
Compression Time Comparison
| Compression |
Real Time |
User Time |
System Time |
| Brotli (q4) |
0.012s |
0.008s |
0.004s |
| Gzip |
0.021s |
0.012s |
0.004s |
Tailwind benefits the most from this (due to the repeating CSS classes) while json remains almost unchanged. Considering that taildwind best suits the htmx philosophy, I think the community should pay attention to brotli.
People always forget about brotli for some reason. Although it is especially good for html and css. Yes, it is slow by default. But you can use a small compression level (1-4) and get better compression with less time. I made a small comparison:
File Sizes (bytes)
Compression Time Comparison
Tailwind benefits the most from this (due to the repeating CSS classes) while json remains almost unchanged. Considering that taildwind best suits the htmx philosophy, I think the community should pay attention to brotli.