
Question:
Would facebook get notifications via comet push or an ajax script that checks for new notifications every second? and which is more efficient for such a system?
Answer1:It looks more like comet to me, there is a GET request to ?.??.channel.facebook.com that takes 55 seconds to time out. This GET request repeats the entire time I have the page loaded - This is how <a href="http://en.wikipedia.org/wiki/Comet_%28programming%29#Ajax_with_long_polling" rel="nofollow">long polling</a> works. I'm using Chrome, it could use a different transport for another browser.
If there were to be a notification, the request would complete before the 55 seconds timeout. Say at 30 seconds, and another GET request would be made. This is certainly more efficient than polling every second.
Answer2:I haven't worked with Comet and can't tell if it's "faster" than ajax. Facebook uses Ajax (just activated Firebug), first request goes to http://www.facebook.com/ajax/chat/history.php?...
.