roadrunner
roadrunner copied to clipboard
[π‘ FEATURE REQUEST]: Add `zstd` support
Plugin
HTTP Middleware (any)
I have an idea!
Nowadays, zstd became very popular compression standard in web world due to the ratio/speed balance of the corresponding Zstandard compression algorithm.
https://en.wikipedia.org/wiki/Zstd
I think, it would be awesome to have it as a separate middleware to promote zstd support to RoadRunner-backed servers.
EDIT: Pure Golang package: https://pkg.go.dev/github.com/klauspost/compress/zstd#section-readme
Example Usage
HTTP client sends:
Accept-Encoding: zstd
HTTP server sends:
Content-Encoding: zstd
Then, zstd-packed content after the headers.
EDIT(rustatian): if someone wanted to contribute, I've created a repository link for that.
- Check the gzip plugin middleware.
- Copy everything from it and replace gzip with zstd.
- Add tests to the http plugin with that plugin OR you may include tests in the zstd repository.
I digged into this before. IUUIC, zstd will make sense for static content compression rather on the fly for each request:
- too expensive cpu-wise
- browser support is still not ubiquitous https://caniuse.com/zstd
If anything, brotli might be a better candidate. https://caniuse.com/brotli
@rauanmayemir, maybe we should create two separate issues for @rustatian to decide.
Adding zstd is very easy. It can be added and if someone wanted to use it - they'd have their reasons.
On the other hand, brotli implementation in most cases would require CGO, which won't be added (i mean, CGO) to RR for sure. I know about one pure Go implementation of that compression algorithm, but I'm not sure that it is properly supported.
@rustatian, letβs go for the zstd then! β€οΈ
Stumbled on to this issue, I might play around with a plugin for this, using this implementation: https://github.com/klauspost/compress/tree/master/zstd#zstd
@sicet7 ππ»
Yeah, you may just copy-paste our gzip plugin and replace everything in it with zstd
Hi, is there any progress on this issue? @sicet7 @rustatian