
Hi folks! Your website doesn’t reload fast and takes more time to get response . Then this is perfect time to move to HTTP/2. The relatively new HTTP/2 protocol speeds up page load significantly and is widely supported by all major browsers and servers. You should be using it right now.
What is HTTP?
HTTP is based on the Client/Server model. Client/Server model can be explained as two computers, Client (receiver of service) and Server (provider of service) that are communicating via requests and responses.
A simple and abstract example would be a restaurant guest and a waiter. The guest (Client) asks (sends request) waiter (Server) for a meal, then the waiter gets the meal from the restaurant chef (your application logic) and brings the meal to the guest.
This is a very simplistic example, but it is also the one that will help you understand the concept.
Disadvantages of HTTP/1.1
Previously,HTTP/1.1 was the major version of HTTP network protocol used by the World Wide Web, implemented across clients and servers. That worked well for 15 years. But as modern day applications and websites evolved and the amount of data to be loaded on a single page increased, the shortcomings of HTTP/1.1, became more prominent.
One open request per connection
HTTP/1.1 practically allows only one outstanding request per TCP connection (though HTTP Pipelining allows more than one outstanding request, it still doesn’t solve the problem completely). The browsers, to circumvent this limit, implement multiple parallel TCP connections to every domain(the number of parallel connections varied per browser). But this head-of-line blocking nature of HTTP/1.1 is a major bottleneck for faster loading applications.
Duplication of data
The other problem with HTTP/1.1 is the duplication of data across requests (cookies and other headers). Too many requests means too much redundant data, which would impact performance.
This led to the development of techniques like image sprites (combining multiple image requests into a single one) and domain-sharding (splitting the requests for resources over multiple domains to increase the number of possible parallel TCP connections).
What Is HTTP/2?
HTTP/2 is the latest update to the HTTP protocol by the Internet Engineering Task Force (IETF). The protocol is the successor to HTTP/1.1, which was drafted in 1999. HTTP/2 is a much-needed refresh, as the web has changed over the years. The update brings with it advancements in efficiency, security and speed.
Where Did HTTP/2 Come From?
HTTP/2 was based largely on Google’s own protocol SPDY, which will be deprecated in 2016. The protocol had many of the same features found in it and managed to improve data transmission while keeping backwards compatibility. SPDY had already proven many of the concepts used in HTTP/2.Major Improvements In HTTP/2.
Test How Fast HTTP/2 Is!
Don’t just take our word for it. We’d like you to test for yourself how awesome HTTP/2 is for your website’s overall speed and performance. Click on the link below to run a test and compare HTTP/1.1 versus HTTP/2. You will then clearly see noticeable improvement in speed when you decide to move to HTTP/2.
http://imagekit.io/demo/http2-vs-http1
Improved Features of HTTP/2
Multiplexing
One of the striking limitations with HTTP/1.1 is that it can only transfer one request per TCP connection at a time. This forces browsers to utilise multiple TCP connections to simultaneously handle multiple requests.
With HTTP/2, multiple HTTP requests are now possible on just one TCP connection. This means that transferring resources to a website will be faster and more efficient.
Server Push
HTTP/2 uses a procedure called server push where servers understand which files the browser need before the browser requests for them.
The server will technically “push” these files to browsers before the latter can even request for them. This makes the entire process of retrieving all resources needed to run a website faster.
Binary Protocols
HTTP/1.1 processes text-based commands to complete requests which may transmit excess data. HTTP/2 cuts down the amount of data transmitted by implementing it through the binary protocol which simplifies how a client’s computer interprets the transmitted information. This saves time translating information from a text to binary. This can significantly improve load time and overall performance.
Header Compression
For media-rich websites, clients have to push multiple header frames; this leads to latency and uses extraneous consumption of network resources. HTTP/2 addresses this issue by compressing a large size of redundant header frames.
It uses HPACK compression which compresses individual value for each header before transmitting it to the server. It then searches the encoded information from a list of previously transmitted header values to reassemble the full header information.
Stream Prioritisation
One of the weaknesses of HTTP/1.1 is the minification of CSS files and JavaScript. This is to reduce bandwidth and boost performance based on smaller file sizes.
The implementation of HTTP/2 prioritisation allows clients to provide preference over particular data streams. This means that only the codes needed by a certain web page will be served to visitors. Since requests are simultaneous on HTTP/2, loading several small stylesheet files will not be a problem.
How should I move to HTTP/2?
The HTTP working group maintains a comprehensive list of implementations of HTTP/2 on different servers. You can upgrade your server, if one is available, to support HTTP/2. For resources that are being loaded from a CDN or a 3rd-party provider, you would need to get in touch with them to upgrade to HTTP/2 if needed.
Also note that while most of your users would be able to use HTTP/2, a few of them might still be accessing your application from older browsers. Thus the performance optimisations done for HTTP/1.1 would still be important and worth keeping.
Conclusion
Although HTTP/2 is still fairly new, support for it continues to grow. Most major browsers support HTTP/2 including Microsoft Edge, Firefox, Chrome, Safari, and Chrome for Android. Many popular web servers include native support for HTTP/2 including the Apache HTTP Server, NGINX, and Tomcat. As software support for HTTP/2 increases, so will adoption across websites and web platforms.
Great Article on HTTP/2.