alfred icon indicating copy to clipboard operation
alfred copied to clipboard

HTTP/2

Open felixblaschke opened this issue 3 years ago • 3 comments

Any thoughts about that?

felixblaschke avatar Apr 14 '21 16:04 felixblaschke

Haven't thought about it yet!

To be fair I have never used http/2 for anything as of yet so it's one of those I don't know what I don't know kind of things.

It does look like there is an "official" implementation: https://github.com/dart-lang/http2

but I get the impression its kind of experimental.

What are your thoughts?

rknell avatar Apr 14 '21 22:04 rknell

I did a little quick research on that. The number one feature of http/2 is connection multiplexing. The browser TCP connection limit is around 6 for major browsers. So benefit is loading time if you have many requests. If you have a spotty connection with package loss, http/1.1 can be more efficient cause only a single TCP connection stops and resolves the lost package. With http/2 the whole multiplexed pipeline stops. They try to improve on that with http/3 (which is http over QUIC over UDP).

Back to topic. While http/2 is technically not attached to TLS, most browser only accept http/2 when properly using TLS. For backend developers this means juggling around with encryption keys inside dart code. For my own project I used an apache2 reverse proxy to add TLS encryption. I don't know if there is a http/1 to http/2 upgrade mechanism inside apache2 or ngx. That would be useful, cause on localhost or within data center, you have very fast connections.

I'll guess http/2 not mandatory yet, but it looks like something to adapt to in the future.

felixblaschke avatar Apr 15 '21 05:04 felixblaschke

HTTP/2 server push is a feature for which alone I would consider adding support for it.

https://en.wikipedia.org/wiki/HTTP/2_Server_Push

daniel-v avatar Dec 07 '22 16:12 daniel-v