Please Support HTTP/2 Server Push
anonyco opened this issue · comments
I love the speed and performance of Rapidoid, but there would be even greater speed/performance gains if Rapidoid started supporting HTTP/2 push. The majority of users have a browser that supports HTTP/2, so it's time to do it. Here are the features that would need to be implemented:
- Auto-discovery of HTTP/2: https://http2.github.io/http2-spec/#discover-https
boolean supportsHttpPush()
andint getHttpVersion()
methods on the Resp (https://www.rapidoid.org/docs.html#_the_http_api) class. Currently,supportsHttpPush()
will return true whengetHttpVersion()
is 2, andgetHttpVersion()
returns0
for HTTP/1.0,1
for HTTP/1.1, and2
for HTTP/2 right now.Resp appendPushPromise(Resp other)
appends another Resp onto the HTTP/2 promise frame if the request is HTTP/2 and returnsother
.
That's all that you need to implement to help us make our websites many many times faster than they already are. Some things down the road to implement:
- HPACK header compression: https://blog.cloudflare.com/hpack-the-silent-killer-feature-of-http-2/
- Caching the HPACK headers
HTTP/3 will come with some additional enhancements that build ontop of HTTP/2 that you can worry about later (if ever at all). The upgrade from HTTP/1.1 to HTTP/2 is enormous for performance, whereas the upgrade from HTTP/2 to HTTP/3 will not be as dazzling. Nevertheless, you may want to look into HTTP/3 eventually as it will take quite a lot of burden off the server via intelligent caching.