Giter VIP home page Giter VIP logo

bigpipe's Introduction

Open BigPipe implementation
===========================

This in an open bigpipe implementation written for IRC-Galleria (http://irc-galleria.net) which is implemented by
loosely following facebook implementation describied at
http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919

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
 - h_bigpipe.inc BigPipe class php file
 - h_pagelet.inc 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 (http://chrisschuld.com/)
 - prototype.js Prototypejs.org library
 - prototypepatch.js Patches for prototype
 




bigpipe's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.