HTTP/2.0

After almost 20 years since the last release of HTTP, the new version of HTTP was released in 2015. This new version of the protocol has several enhancements over the previous versions. Some of these enhancements will also affect the way server applications will be developed.

The first and most important enhancement is that the new protocol will make it possible to send several resources parallelly in a single TCP connection. The keep-alive flag is available to avoid the recreation of the TCP channel, but it does not help when a response is created slowly. In the new protocol, other resources can also be delivered in the same TCP channel even before one request is fully served. This requires complex package handling in the protocol, but this is hidden from the server application programmer as well as the browser programmer. The application server, servlet container, and browser implement this transparently.

HTTP/2.0 will always be encrypted, therefore it will not be possible to use http as a protocol in the browser URL. It will always be https.

The feature that will need changes in servlet programming to leverage the advantages of the new version of the protocol is server push. Version 4.0 of the servlet specification includes support for HTTP/2.0, and this version is still in draft.

Server push is an HTTP response to a request that will come in the future. How can a server answer a request that is not even issued? Well, the server anticipates. For example, the application sends an HTML page that has references to many small pictures and icons. The client downloads the HTML page, builds the DOM structure, analyzes it, and realizes that the pictures are needed, and sends the request for the pictures. The application programmer knows what pictures are there and may code the server to send the pictures even before the browser requests for it. Every such response includes a URL that this response is for. When the browser wants the resource, it realizes that it is already there and does not issue a new request. In HttpServlet, the program should access PushBuilder via the request's new getPushBuilder method and use that to push down resources to the client.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.55.193