Is a set of rules that allow two or more entities to transmit and receive information, it defines the syntax, semantics, and synchronization of communication and possible error recovery methods.
Is the protocol that governs the connection of computer systems to the Internet.It has a special mechanism that ensures data is safely transferred without errors from one point to another.
Is a major revision of the Hypertext Transfer Protocol (HTTP), the protocol used by the World Wide Web. this protocol uses TCP/IP to transfer its information between computers (usually Web servers and clients).
Multiple HTTP requests can be sent and responses can be received asynchronously via a single TCP connection.
HTTP/2 compresses the individual value of each header before it is transferred to the server, which then looks up the encoded information in list of previously transferred header values to reconstruct the full header information.
HTTP/2 allows the server to send additional cacheable information to the client that is not requested but is anticipated in future requests.
HTTP/2 includes the ability to send "hints" indicating the importance of a given stream (priority) relative to other streams on the same connection, so that resources can be allocated appropriately.
HTTP1.x used to process text commands to complete request-response cycles. HTTP/2 can use binary commands to execute the same tasks.
HTTP/2 prevent multiple attacks possible today with HTTP 1.1 because the way it handles the headers with HPACK and the mandatory use of encryption, HTTPS is required
The header compression feature allows mobile sites with high amount of requests to prevent wasted megabytes from the headers from being downloaded.
Common practices like Spriting, Concatenating, Domain sharding and others are not longer needed
HTTP/2 is fully backwards-compatible with HTTP/1.1, meaning websites will work the same with either protocol.
Text
SSL certificates could be expensive if not using letsencrypt.org and will require some setup.
In case your website’s optimization is good, you may not find the improvements in your performance so impressive.
The protocol is still relatively new; a lot of studies will have to be conducted in order to determine best practices and possible pitfalls.
Experimental support in Node v8 Carbon, Stable in Node v10 Dubnium
const http2 = require('http2')
const server = http2.createSecureServer(options);
server.on('stream', (stream, requestHeaders) => {
stream.respond()
stream.end('HTTP/2 hello world!')
})
server.listen(4300)