ngtcp2 / nghttp3

HTTP/3 library written in C
https://nghttp2.org/nghttp3/
MIT License
868 stars 94 forks source link

Compression of custom headers #100

Closed amirlivneh closed 1 year ago

amirlivneh commented 1 year ago

Our product makes extensive use of custom headers. nghttp3 seems to only compress a set of well known headers, but not custom headers. We suspect that sending these headers using their literal representation hurts performance and user experience, especially in slow networks. Another library we're using allows the user to specify which custom headers should be compressed. Would it be possible to provide a similar capability in nghttp3?

tatsuhiro-t commented 1 year ago

Compressing every header fields is not nice because it quickly fills up storage, especially there are large ones. But compressing selected header fields by application would be a good workaround. Perhaps, we can add new NGHTTP3_NV_FLAG to give a hint to the compressor.

crytaljin commented 1 year ago

@tatsuhiro-t Great idea! Do you have an estimate of when you'll be able to implement this?

tatsuhiro-t commented 1 year ago

101 implements this.

crytaljin commented 1 year ago

Thank you!!

amirlivneh commented 1 year ago

I can confirm that this change reduces the latency of HTTP requests, especially on cellular networks at the high percentiles of latency distribution. This translates to a measurable improvement in user experience.