Push (Comet) or pull ?

What is it ? Most of the modern web applications display recently updated data, and to do that they need to get he latest data very frequently. Some of them even include some real-time chat (Gmail Chat, Facebook chat). How ? That’s the interesting part. Pull is pretty dumb. You do a request very frequently and you see if anything new appeared. This consumes some bandwidth, some resources (because server has to check if data has actually changed). Push is going back to the source : Once you’ve made the request on the server, it doesn’t reply instantly. It will wait for something before sending anything. So push over HTTP is in fact a pull with a sleeping response. Using push over HTTP is called Comet. So pushing data isn’t very complex, it just requires a special server to transmit some data (text, html, xml, or image) over an already opened HTTP connection. ...

November 23, 2009 · Florent Clairambault