compression icon indicating copy to clipboard operation
compression copied to clipboard

Support zstd

Open bjohansebas opened this issue 1 year ago • 4 comments

Node.js will soon have official support for zstd. Once it is available in an official version, we can add support for it

bjohansebas avatar Feb 08 '25 15:02 bjohansebas

I think the best thing to do is to wait until the API is stable. It will be released as experimental in the next version 23

bjohansebas avatar Feb 11 '25 23:02 bjohansebas

@bjohansebas With Node 24 now current, will this land anytime soon? I can see a PR opened 🙏

isaachinman avatar Aug 27 '25 11:08 isaachinman

Hey, there’s already another PR open for that. I’ve been thinking about this for several months, we could probably add it, but I need to discuss it with other team members to make sure they agree. For example, Fastify has already adopted it as far as I know, though it might be better for version 2? With the option to disable it using new configuration options (https://github.com/expressjs/compression/pull/232)

bjohansebas avatar Aug 28 '25 01:08 bjohansebas

For what it's worth, gzip performs better for small payloads, it seems like zstd benefits start being a benefit once you are above several kb.

Given this repo enables Brotli by default I think users will see a performance and compression gain either way, but if they are upgrading from pre Brotli compression middleware, a well oiled api server will see a performance decrease.

Making compression formats will definitely be asking more from end users but would be a boon to those that know what they want.

mattmatters avatar Aug 31 '25 00:08 mattmatters