-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for wrap-decompression
middleware
#683
Comments
|
I'm interested in working on this ticket. |
Great! Welcome to aleph.
First, we need a plan before writing code.
Not all Aleph middleware is implemented as actual middleware. It's meant to
have API parity with clj-http, but the underlying architectures are
different. Pretty sure the codec code will be like that.
I'll share some more ideas when I'm back at my computer.
On Sun Nov 5, 2023, 11:09 PM GMT, RAJKUMAR NATARAJAN ***@***.***> wrote:
I'm interested in working on this ticket.
—
Reply to this email directly, view it on GitHub
<#683 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHB5LXQDIP2GQ4QPAFRFTYDAFBJAVCNFSM6AAAAAAZK2RIUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTHA3TMMZVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
PreparationFirst, I would do your work against the HTTP/1For the H1 client code, what we'll probably want to do is, look for the HTTP/2For the H2 client, I believe Though on a side note, we probably shouldn't add Zstd issuesOne catch is, Netty doesn't support Zstd decoding yet. We have several options:
Might be simplest to do (1), and add full support when (2) is ready. |
@KingMob Thanks for your suggestions. Also, I didn't get this what do you mean regarding the note - we probably shouldn't add h2-compression-handler to client pipelines, just servers. |
@rajcspsg Part of this will have to be done with Netty. Compression in Netty isn't done with a pipeline handler, but by injecting codec classes into the If you call So for H2, I think this PR will need to
Unlike clj-http, we probably want to add Brotli to the default list. clj-http defaults to adding "gzip, deflate" to whatever's already in the header (if anything), which is not quite correct, but good enough 99.99% of the time. We should leave out zstd and snappy from the defaults, I think. Zstd is promising but still only has partial support. Snappy is niche, and not supported by browsers.
This is a little out-of-date. Right now, we don't add it to clients, but the docs and key names used aren't very clear that it's server-only. The |
BTW, did you vote on https://clojurians.slack.com/archives/C0G922PCH/p1702723929287379 ? |
yes I did :) |
Hmm, I don't see your name on the vote emojis... |
clj-http has middleware support for automatically decoding compressed body data via
wrap-decompression
. As aleph's HTTP client has the explicit goal of clj-http compatibility, we should add this too.Right now, if you send the header "accept-encoding: gzip, deflate" and get a compressed body back, you have to manually decompress it yourself.
gzip and deflate are the minimum necessary; brotli support should also be added, if available.
The text was updated successfully, but these errors were encountered: