Skip to content
Open BigPipe implementation
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead of linares:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Open BigPipe implementation

This in an open bigpipe implementation written for IRC-Galleria ( which is implemented by
loosely following facebook implementation describied at

BigPipe allows speeding up page rendering times by loading the page in small parts called pagelets.
This allows browser to start rendering the page while the php server is still processing to finish the rest.
This transforms the traditional page rendering cycle into following steps:

 1) Browser requests the page from server
 2) Server quickly renders a page skeleton containing the <head> 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.
 3) Browser will start downloading the bigpipe.js file and after that it'll start rendering the page
 4) The PHP server process is still executing and its building each pagelet at a time. Once a pagelet
    has been completed it's results are sent to the browser inside a <script>BigPipe.onArrive(...)</script> tag.
 5) Browser injects the html code received into the correct place. If the pagelet needs any CSS resources those are
    also downloaded.
 6) After all pagelets have been received the browser starts to load all external javascript files needed
    by those pagelets.
 7) After javascripts are downloaded browser executes all inline javascripts.

There's an usage example in example.php. Take a good look on it. The example uses a lot of whitespace padding to
saturate web server and browser caches so that the bigpipe loading effect is clearly visible. Of course these
paddings are not required in real usage.

Files included:
 - bigpipe.js Main javascript file
 - BigPipe class php file
 - Pagelet class php file
 - example.php Example showing how to use bigpipe
 - test.js Support file for example
 - test2.js Support file for example
 - README This file
 - Browser.php Browser detection library by Chris Schuld (
 - prototype.js library
 - prototypepatch.js Patches for prototype

You can’t perform that action at this time.