Exploring http2 (Part 1): Overview

source: https://css-tricks.com/

Let’s talk about What, why, when and how of http2

The complete code can be found on github.

Part 1: Overview
Part 2: Exploring with node-http2 core and hapijs

What is http2?

http2 is the latest update after http1.1 which is being used since 1999.

The http2 protocol is focused on performance; specifically, end-user perceived latency, network and server resource usage. (Read about the specifications here)

Why http2?

In other words what’s wrong with http1.1

Loading a web page is resource intensive, as HTTP/1.1 only allows one outstanding request per TCP connection. The web needed an update which brings in advancements in efficiency, security and speed.

How does http2 solve performance problems?

Improvements http2 brings in:

  • Single Connection: Only one connection to the server is used to load a website and that connection remains open as long as the website is open. This reduces the number of round trips needed to set up multiple TCP connections. (more info here)

When can we start using http2?

Now!

Here is the timeline,

source: https://www.polyglotdeveloper.com/

Yes, from 1999 to today we(most) are using same good old http1.1; 15 years!

How to start using http2?

Here is the list of library implementations for http2 in various languages.

According to Can I Use, ~83% browsers online support http2 already

See it in action, http1.1 vs http2 (network throttled: fast 3g)

http1.1 (left) vs http2 (right); let’s build this in next section

In the next part let’s build a simple server with http2 support; with http1.1 backward compatibility; step by step with http2-node core and hapijs.

Part 1: Overview
Part 2: Exploring with node-http2 core and hapijs

The complete code can be found on github.

If you found this story useful, please support it by clapping 👏

I Code. I Paint. I Ride

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store