user663049
user663049

Reputation: 1178

Does facebook use comet or ajax for its notifications?

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?

Upvotes: 0

Views: 1832

Answers (2)

Steve K
Steve K

Reputation: 19586

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.

Upvotes: 1

halfdan
halfdan

Reputation: 34204

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?....

Upvotes: 1

Related Questions