Categories

(111)
(64)
(170)
(22)

Improve your website’s speed with HTTP/2 Server Push

21.07.2017
Improve your website’s speed with HTTP/2 Server Push
Author:

Always be one step ahead, predict what will be needed, and offer it even before you’ve been asked — this is the secret of business success, especially in the 21st century. This is also the principle of work of HTTP/2 Server Push, the technology we will consider today as one of the options to optimize your website’s loading speed.

HTTP/2 and its secrets

First of all, let’s take a look at HTTP/2, the latest version of the well-known protocol. Just switching to it, with no changes to the code or other “magic tricks,” can give websites a noticeable performance boost.

So what makes HTTP/2 beneficial as compared to its predecessor, HTTP/1.1? The two main reasons are the single TCP connection and the Server Push concept.

Single TCP connection

HTTP/1.1 operates numerous TCP connections to handle numerous requests, which may lead to website performance losses.

Luckily, HTTP/2 addresses this problem by using only one TCP connection for all requests, allowing all responses to be sent in parallel over this connection. The server and the browser communicate through so-called streams marked with IDs, which is much faster.

HTTP/2 Server Push

There is another exciting new concept in HTTP/2 called Server Push. Today, most websites use various types of resources like HTML, stylesheets, and scripts (index.html, styles.css and script.js). Traditionally, when a browser makes a request to the server, it fetches and parses the HTML first, then discovers it also needs JavaScript and CSS and makes follow-up requests. These round trips make the server yawns waits patiently, while the network stays pretty idle.

HTTP/2 Server Push is here to change the rules of the game. It allows the server to predict what other resources will be needed and send (or push) them preemptively, without waiting for the browser to request them. So, while the browser parses the HTML, other files (JavaScript and CSS) are getting ready. This approach leads to a loading speed increase.

In other words, the server takes the initiative to provide more after the browser’s initial request. In addition, popular items for pushing include the next pages a visitor will probably go to, redirects, and more.

PUSH_PROMISE frame

The server makes promises and fulfills them with HTTP/2 Server Push. Before the pushing process, it prepares a PUSH_PROMISE frame describing what resources that are going to be sent, so the browser knows what to expect.

A wise approach

For good results, using HTTP/2 Server Push requires some careful planning. For example, you should push with care, and only push what will be really needed. It is also necessary to take care of the proper caching of the pushed assets and make sure they are not forced upon browsers again and again.

HTTP/2 Server Push can be a truly powerful speed-gaining tool when managed right. Contact us and we can help you make the best use of all its capabilities. We know what you expect before you even ask. And we will deliver it to you! We promise ;)

1 vote, Rating: 5

Read also

1

Have you ever wanted to interact and collaborate with your users through the content? This is possible with H5P (HTML 5 Package). In...

2

It is no exaggeration to say that PHP is one of the most popular programming languages. As most developers have an essential background in PHP and understand how it works, we’re going to tell you...

3

Mobile devices are taking over the world, and there is no way web resources can ignore this. We offer you an article about mobile app testing — in a form of checklist. So, if you have decided...

4

Let’s have a look at the modular website framework built for higher education institutions — OpenEDU.

5

We, Internetdevels, are a successful company who have worked in the IT sector for more than 9 years. We are trying hard to match the...

Need a quote? Let's discuss the project

Are you looking for someone to help you with your Drupal Web Development needs? Let’s get in touch and discuss the requirements of your project. We would love to hear from you.

Join the people who have already subscribed!

Want to be aware of important and interesting things happening? We will inform you about new blog posts on Drupal development, design, QA testing and more, as well news about Drupal events.

No charge. Unsubscribe anytime