Whenever you click on a link to visit a site a request gets made to the server. The server answers with a status message (header) and a file list for that website. After viewing that list, the browser asks for the files one at a time. On the ‘old’ HTTP1.1 protocol, this process takes ages as there is only one line available that has to open and close after each file has been sent. HTTP/2 offers a dramatic speed boost as the line can be kept open and a lot of stuff can be sent at once. Meet HTTP/2!

HTTP/2 is a newish protocol that will drastically speed up the web. It uses new technologies to take away one of the biggest bottle necks of the web introducing full multiplexing connections. Servers can now open a single connection with a browser and keep sending all the files of a site until everything is done. After that the connection closes and the browser can render the site.

How Does Http/2 Work?

Let’s Say You Want a Brand-new Box of Lego. First, You Go to the Store to Get a Specific Box. when You Get Home, You Open the Box and See the Instructions. the Instructions Say What You Have to Do: One Brick at a Time. Now, You Can only Get One Brick at a Time. You Have to Keep Asking the Instructions: “which Brick Do I Need Now?” and the Instructions Will Look and Give You the Right Brick. This Back-and-forth Keeps Happening until You Have Finished the Entire Lego Set. Does the Set Have 3300 Bricks? Well, that’ll Take a While. This Is Http1.1.

With HTTP/2 this changes. You go to the store to pick up your box. Open it, find the instructions and you can ask for all the bricks used on a part of the LEGO set. You can keep asking the instructions for more bricks, without having to look at the manual. “These bricks go together, so here they are.” If you want it really fast, you could even get all the bricks at once so you can build the set in an instant.

Http/2 Can Handle More Things at Once

Http/2 Has a Lot of Cool Features that Can Help Speed up Your Loading Times. the Most Important One, of Course, Is Full Multiplexing. This Means that Multiple Requests Can Happen at the Same Time Over a Connection that Stays Open for the Duration of the Transfer Process. Another Cool Thing Is Server Push; This Starts as One Request but when the Server Notices the Html Requires Several Assets, It Can Send These All at Once without Asking. This Might Be a Good Fit for Your Site, but that Depends on Factors Too Hard to Explain Here.

Like I said in the intro, with HTTP1.1 a browser requests a site -> server sends a header back -> that header contains a status message and HTML body -> for every file needed to build the site, a single connection has to be opened and closed and opened and closed. Whenever a piece of this puzzle acts up it can hold back the rest, slowing the process down even further. This is called head-of-line blocking and it sucks big time. This is one of the many reasons why HTTP1.1 can use an update.


2018-04-23T12:05:51+00:00April 23rd, 2018|Categories: Technology, Web Design|Tags: , , , , , , , , |