QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Home
  • QIdea
  • QTrack
Home HTTP/2 Complete Tutorial

HTTP/2 Complete Tutorial

http2

HTTP/1.1 was introduced in 1999 and since then the web has changed. More people are accessing websites in mobile and tablets which have relatively slow connection and the number of external resources per page is increasing with causing increase in page load size. Although many HTTP clients and server side hacks had been implemented to make he web better but in the end every hack has its own consequences. Therefore there was need for a new protocol to make the web faster across multiple connection types and devices.

Difference between SPDY and HTTP/2

SPDY is a networking protocol introduced by Google in 2009. Its aim was to decrease web latency(time interval between request and response) and increase security.

HTTP/2 is a clone of SPDY. Google has now stopped developing SPDY and started working on HTTP/2 with the same ideas of SPDY.

HTTP/2 Aims

Here is a list of objectives of HTTP/2 protocol:

  1. Reduce latency
  2. Reduce total number of TCP connections i.e., reduce number of open sockets
  3. Better web security.
  4. Maintain compatibility with HTTP/1.1 clients and server.
  5. Maintain same usability as HTTP/1.1 i.e., can be used wherever we use HTTP/1.1
  6. Better web security.

HTTP/2 Features

Here is a list of features of HTTP/2

  1. Multiplexing: Multiple asynchronous HTTP requests over a single TCP connection.
  2. Server Push: Multiple responses for single request
  3. Header Compression: Compress HTTP headers along with content.
  4. Request prioritization: While making multiple HTTP requests to a same domain they can be prioritized.
  5. Binary Protocol: HTTP/2 is binary protocol whereas HTTP/1.1 is text protocol.

What HTTP/1.1 problems does HTTP/2 Address

Here are the list of HTTP/1.1 problems solved by HTTP/2

  • HTTP Pipelining: Some HTTP/1.1 clients have been using this technique to reduce the number of TCP connections. HTTP pipelining is a technique in which multiple HTTP requests are sent on a single TCP connection without waiting for the corresponding responses. But the server sends its responses in the same order that the requests were received — so the entire connection remains first-in-first-out and HOL blocking(delay of one response will delay other too) can occur. In HTTP pipelining parallel requests were made asynchronously but server responses synchronously. HTTP/2 solves this issue by introducing multiplexing, in which multiple requests and responses both are made asynchronously over a single TCP connection which indeed removes the HOL blocking issue.
  • Multiple TCP Connections for Same Domain: In HTTP/1.1 there was need for multiple TCP connections to same domain to make multiple HTTP requests. But in HTTP/2 only one TCP connection per domain is allowed and all HTTP requests are made through that TCP connection asynchronously using multiplexing.
  • TCP Connection Close Time: In HTTP/1.1 a TCP connection is closed as soon as the HTTP requests is finished. But in HTTP/2 the TCP connection can be live for a longer period of time.
  • Header Compression: In HTTP/1.1 there was no header compression but in HTTP/2 there is header compression. Which decreases the latency further.

Here is a tutorial series on individual features and objectives of HTTP/2

  • HTTP/2 Compatibility with old Browsers and Servers

    One of the biggest question that comes in is how is old browsers going to deal with HTTP/2 web servers and vice-versa.HTTP/2 uses an Upgrade and D ...Continue Reading

  • What is Multiplexing in HTTP/2?

    Multiplexing is a method in HTTP/2 by which multiple HTTP requests can be sent and responses can be received asynchronously via a single TCP connectio ...Continue Reading

  • What is Server Push and Promises in HTTP/2?

    Server push is a method in HTTP/2 which allows server to send multiple responses for a single request. This feature decreases the latency in loading a ...Continue Reading

  • Header Compression in HTTP/2

    Headers in HTTP/2 provide information about the request or response. Header take around 800 bytes of bandwidth and sometimes few KB if it carries cook ...Continue Reading

  • HTTP/2 for WordPress Sites

    HTTP/1.1 is a old protocol that is being used in modern websites which are very different from the websites of the time HTTP/1.1 was introduced. There ...Continue Reading

Mar 13, 2015Narayan Prusty
Creating a WordPress Admin ThemeCreate a WordPress Post Editor Button to Add Shortcode
Comments: 2
  1. Clenbuterol UK
    6 years ago

    **

    Easy option to get useful information as well as share good stuff with
    good ideas and concepts

    **

    ReplyCancel
  2. Suresh
    6 years ago

    Hi There,
    If I my assert serving https, I can see h2 in network protocol. but if my assert serving http I can see only http/1.1. How can I confirm my assert serving http2 over http protocol.Thanks in advance.

    ReplyCancel

Leave a Reply to Clenbuterol UK Cancel reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Narayan Prusty

I am a software engineer specialising in Blockchain, DevOps and Go/JavaScript. This is my personal blog where I write about things that I learn and feel interesting to share.

8 years ago 2 Comments Web Development
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
  • Difference between SPDY and HTTP/2
  • HTTP/2 Aims
  • HTTP/2 Features
  • What HTTP/1.1 problems does HTTP/2 Address
Related Articles
  • PageSpeed Insights API
  • URL Tracking Parameters and Its Negative Impact
  • Response Tabs – Horizontal and Vertical
  • Increase PHP Script Execution Time
  • How Web Caching Works?
Our Sponsor
My Books

2014 - 2015 © QNimate
All tutorials MIT license