QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Home
  • QIdea
  • QTrack
Home Carbon Ads What is Server Push and Promises in HTTP/2?

What is Server Push and Promises in HTTP/2?

This post is a part 3 of HTTP/2 Complete Tutorial post series.

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 webpage.

To make an HTTP/2 request client first checks if a TCP connection is already open or not. If not open then establishes a new TCP connection otherwise uses a the existing connection. It then sends an HTTP/2 request. If server feels that the client would need additional resources(also called as promises) or may request some additional resources afterwards the server along with the main response stream sends push promise streams hinting the client with the URL of the additional resources. Now client can request those additional resources via the same TCP connection. Client can also ignore the addition resources URLs or use the cached version if there is.

For every hinting resource a new response stream is created with only the resource headers not the actual content. This response stream is called as push stream. This streams are transferred via the same TCP connection. These streams have high priority then the original request i.e., sent to client before original request. The first frame of the push stream is called as push frame and is used to tell client that the server wants to push this additional resource.

This technique is useful while loading web pages which have external style sheets and script files attached to it. Developers don’t need to combine external resources anymore as HTTP/2 optimizes this issue.

Note: Server can only hint additional resource belonging to same origin policy.

Mar 13, 2015Narayan Prusty
What is Multiplexing in HTTP/2?Header Compression in HTTP/2

Leave a Reply 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 Web Development
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
Related Articles
  • What is Multiplexing in HTTP/2?
  • Pre-rendering In Browser using rel=”prerender”
  • Find Internet Type using HTML5 Network Information API
  • Capturing Webcam Image Using JavaScript
  • Creating Offline Applications using HTML5 Tutorial
Our Sponsor
My Books

2014 - 2015 © QNimate
All tutorials MIT license