Pushing Data to Browser
By Will Fox on Feb. 20, 2014I noticed in one of the classes I take that uses piazza.com as a discussion tool that changes to the page content was pushed real time without refreshing the page. This intrigued me immensely so I did some search and here is what I found out:
It's called "Push Technology", where data is pushed by the server to the browser instead of the browser pulling data from the server.
Q: Is there some way to PUSH data from web server to browser? Of course I am aware of Ajax, but the problem with Ajax is that the browser should poll the server frequently to find whether there is new data. This increases server load.Is there any better method (even using Ajax) other than polling the server frequently?
A1: Yes, what you're looking for is COMET http://en.wikipedia.org/wiki/Comet_(programming). Other good Google terms to search for are AJAX-push and reverse-ajax.
A2: Yes, its called Reverse Ajax or Comet. Comet is basically an umbrella term for different ways of opening long-lived HTTP requests in order to push data in real-time to a web browser. I'd recommendStreamHub Push Server, they have some cool demos and its much easier to get started with than any of the other servers. Check out the Getting Started with Comet and StreamHub Tutorial for a quick intro. You can use the Community Edition which is available to download free but limited to 20 concurrent users. The commercial version is well worth it for the support alone plus you get SSL and Desktop .NET & Java client adapters. Help is available via the Google Group, there's a good bunch of tutorials on the net and there's a GWT Comet adapter too.
A couple of frameworks that implement server pushing: