roadrunner icon indicating copy to clipboard operation
roadrunner copied to clipboard

[💡FEATURE REQUEST]: Early Hints support (103 HTTP code)

Open azjezz opened this issue 4 years ago • 4 comments

Currently, roadrunner allows sending 1 response at the time, this means we can't send early hint ( or any other 1xx ) responses.

Describe the solution you'd like

A solution to be able to send multiple responses at the time to the roadrunner server, this could be done by changing the structure of the payload to be sent ( and ofc ensuring the HTTP server itself is able to handle 1xx responses )

Describe alternatives you've considered

N/A

Additional context

ref:

  • https://github.com/golang/go/pull/42597
  • https://github.com/php/php-src/pull/7025
  • https://github.com/lucas-clemente/quic-go/pull/3047

azjezz avatar Jul 13 '21 05:07 azjezz

Hey @azjezz , thanks for the FR. Likely it will be supported for the http3 (quick protocol) RR plugin rather than the actual HTTP plugin. At the moment we can't write to the ResponseWriter multiply times. According to the chromium discussion and Mozilla, Early Hints are not supported by the ecosystem.

rustatian avatar Jul 13 '21 06:07 rustatian

while early hint is currently no supported by the ecosystem ( servers mostly ), it is supported by browsers, and unlike HTTP2/push, there's no plans to remove it.

from the OP: https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/vOWBKZGoAQAJ

The 103 Early Hints status code (https://tools.ietf.org/html/rfc8297) is expected to provide better performance under certain circumstances by allowing information about resources that the client should request to be sent as soon as available and then making the connection available for carrying data on other streams until the final response is sent. There is active effort to measure the potential latency gain of 103 Early Hints (compared to not using it, without using server push in either case), with the understanding that resources will be allocated to implementing it in Chromium in case data look promising. See https://chromium.googlesource.com/chromium/src/+/master/docs/early-hints.md for more details.

Therefor, i think HTTP2/push feature of RR should be deprecated once 1xx support is accomplished.

azjezz avatar Jul 13 '21 06:07 azjezz

it is supported by browsers

I guess only Google Chrome supports the Early Hints (Safari??), because according to Mozilla bugtracker, at least Firefox does not support it. But, anyway, thanks for the FR, we will track support for the Go's stdlib and when multiply writes will be supported, there are no problems to add 103 HTTP code support.

rustatian avatar Jul 13 '21 06:07 rustatian

Today is the day. GoLang 1.19 is released with supports for 103 Early Hints 🎉

https://twitter.com/golang/status/1554515292390408192

alexander-schranz avatar Aug 02 '22 18:08 alexander-schranz

Hey guys 👋🏻 We discussed this feature with @roxblnfk. Since I'm working on the streaming support, we would like to support 103 Early Hints as well. Planned for the 2023.3.0 release 😃

rustatian avatar Jul 19 '23 21:07 rustatian

Done in 2023.3

rustatian avatar Oct 05 '23 21:10 rustatian