Closed wojtekmach closed 1 year ago
Thoughts in no particular order.
Thank you for the cache/deflate link, very interesting read.
Regarding brotli, I think the brotli
package looks pretty good. I wouldn't include it by default but I'd consider optionally supporting it.
I think something like http_content_encoding sounds appealing.
First of all, we can't use
:zlib.unzip/1
for deflate. If anything, it's:zlib.uncompress/1
:But I don't think it's quite that simple.
Bandit has support for deflate: https://github.com/mtrudel/bandit/blob/1.0.0-pre.11/lib/bandit/compression.ex#L15 but using
:zlib.uncompress/1
there crashes:I trust @mtrudel to have followed the RFCs and implemented this correctly. :) So if you want to mention
deflate
, we should follow his implementation, do the opposite.But, and maybe I'm just burned out with this a bit, I don't think it's worth it. None of the big sites seem to support it. And then there's https://zlib.net/zlib_faq.html#faq39
And then there's this excerpt from
zlib:deflateInit/6
Again I think the implementation is correct because I saw setting
-MAX_BITS
in Python or Ruby too.I had (wrong) support for it in Req and decided to just drop it (https://github.com/wojtekmach/req/commit/e19d89f6c6eb1dd21a373c192f50afa6026fdbac, https://github.com/wojtekmach/req/issues/215) fwiw.