DEV Community

Browser Compression Options 2025

I was exploring the MDN docs and stumbled onto the newer CompressionStream API which enables a couple encodings to compress data streams; namely the popular classic GZIP, and a basic Deflate.

This is a neat first step for the client, but better newer compression encodings exist; these may be forth-coming to the native api one day; Brotli and ZSTD come to mind as the top current ones.

I wanted to test out all the available options I could find to see for myself. So first I searched and was able to find these libs:

High level I reckon ZSTDjs, ZSTDwasm, and then Brotli are top performers... here a screenshot of my findings

Image description

and the repo:

https://github.com/jswhisperer/compression-compare

Future Work for CompressionStreams API, seems like ZSTD and Brotli are green-lit, but how long for browsers to implement is unknown

src

Top comments (1)

Collapse
 
michael_liang_0208 profile image
Michael Liang

Nice post.