Does facebook use comet or ajax for its notifications?
Would facebook get notifications via com开发者_Go百科et push or an ajax script that checks for new notifications every second? and which is more efficient for such a system?
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 long polling 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.
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?...
.
精彩评论