Support for Content-Encoding value zstd in Rack::Deflater.
This algorithm is supported by Chrome, Edge, Firefox and Safari.
Useful for things such as JSON payloads and other dynamic content that cannot be compressed ahead of time. The compression ratio is similar to gzip, but it's twice as fast to decompress and slightly quicker to compress too.
Now supported via deflaters option
Since #2399 there is support for custom deflaters, so something like this should work:
use Rack::Deflater, deflaters: {
"zstd" => lambda { |headers, body| ZstdStream.new(body) }
}
I'm keeping this issue open to track built-in support for zstd. But I think that's blocked on Ruby adding zstd to the standard library (and of course, if maintainers want to close this as completed or not prioritized, feel free to close it).
Resources
Support for
Content-EncodingvaluezstdinRack::Deflater.This algorithm is supported by Chrome, Edge, Firefox and Safari.
Useful for things such as JSON payloads and other dynamic content that cannot be compressed ahead of time. The compression ratio is similar to gzip, but it's twice as fast to decompress and slightly quicker to compress too.
Now supported via
deflatersoptionSince #2399 there is support for custom deflaters, so something like this should work:
I'm keeping this issue open to track built-in support for
zstd. But I think that's blocked on Ruby addingzstdto the standard library (and of course, if maintainers want to close this as completed or not prioritized, feel free to close it).Resources