HTTP & gRPC: Browsers do a lot to make HTTP faster
HTTP/1 is slow and browsers do a lot in the background
--
This article is the first of the HTTP & gRPC series. The aim is not to explain what HTTP is but to highlight its design purpose and what the browsers do in the background to give us a better experience.
This article enables you to stand at the front of the line of people that talk about HTTP and gRPC. Try to read and understand as it helps you a lot in the interview and lays a foundation for HTTP/2 and gRPC. Infact, I was asked in the interview(Company Name: Form 3) that how we can improve the performance of HTTP. This question was not to test my analytical abilities but to check whether I have the knowledge of HTTP/1, HTTP/2 and gRPC.
In this article, we will have a deeper understanding of the HTTP protocol and its versions.
1. A Small Introduction to HTTP
You all know what HTTP is, it is a Layer-7 protocol or the application layer protocol that defines the message format between a client and a web server. HTTP is the de facto standard for communication on the World Wide Web(WWW). Any client and server that implements the HTTP protocol are called HTTP Client and HTTP Server respectively.
1.1 HTTP Clients
All the modern browsers such as Google Chrome, Firefox, Safari and etc can be taken as examples of HTTP Clients as they implement the HTTP protocol.
1.2 HTTP Servers
The web servers or the applications servers like Apache Tomcat, IBM Websphere, Oracle Web Logic, Jetty, Nginx and etc can be taken as examples of HTTP Servers as they implement HTTP Protocol.
All these browsers, as HTTP Clients, do a lot in the background to load the resources faster from the Web Servers (the HTTP Servers).
The protocol is very straightforward in its overview. Below bullet points give us the summary of what it is.
- The client or the browser makes a request to a web server that gives the response back to the client.
- All these Request and Response messages follow a specific format defined by the HTTP protocol.
- Both request and response formats contain headers to pass additional information to the client and server.
- The Request Headers specify…