All-in-one middleware #845
Replies: 1 comment
-
I haven't really pushed for it in gzhttp, since zstd isn't implemented in major browsers and brotli doesn't have Go compression implementation to know knowledge. Technically the Implementation is pretty much implementation independent, except for padding. So adding a "method" to register other methods would be feasible. Adding zstd could be done without too much effort I suspect. Edit (didn't really answer your question): Yes, I'd be happy to have gzhttp do other types. Adding zstd by default would also be fine. If you can make a PR that doesn't break existing API. If BREACH mitigation is enabled, that should take priority, which means that gzip should be preferred until other methods can pad data. |
Beta Was this translation helpful? Give feedback.
-
Hello!
Would you accept a PR that adds a single server middleware which inspects the
Accept-Encoding
header and selects the best available compression implementation?I could build this as a standalone project, but as there's already a bunch of different compression implementations here it seems like this might be a good fit?
I'm imagining something that decodes the header, and then selects
zstd
,brotli
orgzip
depending on what the client claims to supportBeta Was this translation helpful? Give feedback.
All reactions