dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.26k stars 4.73k forks source link

HPACK Huffman compression for request headers #60935

Open sankalpbihani opened 3 years ago

sankalpbihani commented 3 years ago

Is your feature request related to a problem? Please describe.

Currently Huffman de-compression is used when receiving requests but huffman compression is not implemented when sending requests.

Describe the solution you'd like

Implement and enable using huffmann compression for request headers

dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/area-system-io-compression See info in area-owners.md if you want to be subscribed.

Issue Details
### Is your feature request related to a problem? Please describe. Currently Huffman de-compression is used when receiving requests but huffman compression is not implemented when sending requests. ### Describe the solution you'd like Implement and enable using huffmann compression for request headers
Author: sankalpbihani
Assignees: joeloff
Labels: `area-System.IO.Compression`, `untriaged`
Milestone: -
adityamandaleeka commented 3 years ago

@karelz Looks like this request is for HttpClient.

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Issue Details
### Is your feature request related to a problem? Please describe. Currently Huffman de-compression is used when receiving requests but huffman compression is not implemented when sending requests. ### Describe the solution you'd like Implement and enable using huffmann compression for request headers
Author: sankalpbihani
Assignees: joeloff
Labels: `area-System.IO.Compression`, `area-System.Net`, `untriaged`
Milestone: -
scalablecory commented 3 years ago

Similar to outbound dynamic table, we did this and found it using a good bit more CPU for only a slight bandwidth improvement, which didn't seem like a good tradeoff for the common case.

If we implement this, I'd want it to be opt-in either via a setting on SocketsHttpHandler or some flag to HttpHeaders.Add().

scalablecory commented 3 years ago

LLHTTP has a notion of "preparing" headers, so you can e.g. pre-huffman the headers once and reuse them across your app with no cost.

We might consider exposing a similar interface for HttpClient. It will be interesting to integrate such a thing with our current object model.

karelz commented 3 years ago

Triage: Might be reasonable if it helps more customers -- let's wait for more people to raise importance of bandwidth savings.