Skip to content

brotli compression #1

Description

@Jipok

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions