HTTP/2 Server Push: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit
No edit summary
Line 7:
 
== Basic concept ==
Consider a website with three resources: index.html, styles.css and script.js. When a user, through their browser, connects to theWikipedia homewebserver pageto ofget this websitehome page, they automatically retrieve index.html. As the browser parses the [[HTML]] text in index.html, it finds instructions that will require styles.css and script.js. At that point, the browser will issue requests to get these other two files. To assemble the complete webpage, the browser will stack such requests as it gradually discovers the site's composition.
 
With HTTP/2 Push, the server can take the initiative by having rules that trigger content to be sent even before it is requested. In this example scenario, the server knows that anyone requesting index.html will need styles.css and script.js, so it can push them to the client immediately without waiting for the client to request them. If done correctly, by the time the browser finishes parsing index.html, the transfer of styles.css and script.js would have already started, or even completed, removing the latency of having to request these and wait for them to arrive.