- Browser sends an HTTP request to web server.
- Web server parses the request, pulls data from storage tier then formulates an HTML document and sends it to the client in an HTTP response.
- HTTP response is transferred over the Internet to browser.
- After downloading CSS resources, browser parses them and applies them to the DOM tree.
In this scenario, while the web server is processing and creating the HTML document, the browser is idle and when the browser is rendering the html page, the web server remains idle.
Bigpipe concept breaks the page into smaller chunks known as pagelets. And makes page rendering on browser and processing on server side as parallel processes speeding up the page load time.
The request response cycle in the bigpipe scenario is as follows.
- The browser sends an HTTP request to web server.
- Server quickly renders a page skeleton containing the tags and a body with empty div elements which act as containers to the pagelets. The HTTP connection to the browser stays open as the page is not yet finished.
- Browser injects the html code for the pagelet received into the correct place. If the pagelet needs any CSS resources those are also downloaded.
This results in a parallel system where as the pagelets are being generated the browser is rendering the pagelets. From the user’s perspective the page is rendered progressively. The initial page content becomes visible much earlier, which dramatically improves user perceived latency of the page.
Source : https://www.facebook.com/note.php?note_id=389414033919
open bigpipe implementation : https://github.com/garo/bigpipe