rapidoid / rapidoid

Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework and HTTP Server!

Home Page:http://www.rapidoid.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please Support HTTP/2 Server Push

anonyco opened this issue · comments

commented

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() and int getHttpVersion() methods on the Resp (https://www.rapidoid.org/docs.html#_the_http_api) class. Currently, supportsHttpPush() will return true when getHttpVersion() is 2, and getHttpVersion() returns 0 for HTTP/1.0, 1 for HTTP/1.1, and 2 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 returns other.

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:

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.