While HTTP/2 completely renovates core elements of HTTP, it hasn't changed the protocol's high level syntax. This is good news for developers because it means that you should be able to support HTTP/2 without changing your application code. All you need to do is update and/or replace your proxy and server infrastructure. That said, as you adopt HTTP/2 it will likely benefit you to re-think some of your classic HTTP workarounds, such as domain sharding, resource inlining, and image sprites.
Although the Java Servlet 4.0 specification is a work in progress, you can leverage certain HTTP/2 features now by using proprietary web-container extensions or features of pre-connected HTTP/2 proxies. The HTTP/2 proxy nghttpx
is one example. It supports HTTP/2 push by looking into the response-header link fields which includes the attribute rel=preload
; such resources will then be pushed to the front-end client. Once again, we are only at the beginning. Many more implementations are yet to come.
The bottom line is: HTTP/2 is here, and it is here to stay. Make use of it. Make the Web faster.
More about this topic
- The example code for this article is hosted on GitHub.
- Test Internet latency by using Akamai`s network performance comparison monitor.
- Find out whether your browser supports HTTP/2 by calling Akamai's HTTP/2 test page.
- Learn more about the Three important response time limits (Jakob Nielsen, June 2010 ).
- Have a look into the latest version of the Hypertext Transfer Protocol version 2 draft.
- Learn more about HTML5's server-push technologies (Gregor Roth, March 2010).
- Refer to the Java 9 JDK enhancement proposal JEP 110: HTTP/2 Client.
- Refer to the Servlet 4.0 specification requests JSR 369: Servlet 4.0 specification.
This story, "HTTP/2: A jump-start for Java developers" was originally published by JavaWorld.