28146

Does facebook use comet or ajax for its notifications?

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

Recommend

  • VLC player event catch
  • Redis scan skipping keys
  • Expand header row into multiple child rows
  • Python: sending key press events over SSH
  • Double-click autofill - dynamic based on adjacent cell
  • Error in making a socket connection
  • Azure webjobs output logs indexing taking very long
  • Switch to popup in python using selenium
  • quiver not drawing arrows just lots of blue, matlab
  • Suppressing passwd when calling sqlplus from shell script
  • ADO and msqli connections very slow
  • Marklogic : Query response time is very high
  • QLPreviewController hide print button in ios6
  • How to define and use opencv mat of user type
  • print() is showing quotation marks in results
  • Content-Length header not returned from Pylons response
  • Play WS (2.2.1): post/put large request
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Ajax Loaded meta Tags
  • Q promise. Difference between .when and .then
  • How to access EntityManager inside Entity class in EJB3
  • Illegal mix of collations for operation for date/time comparison
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • Does CUDA 5 support STL or THRUST inside the device code?
  • vba code to select only visible cells in specific column except heading
  • htaccess rewriting URLs with multiple forward slashes
  • Symfony2: How to get request parameter
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • retrieve vertices with no linked edge in arangodb
  • File upload with ng-file-upload throwing error
  • A cron job substitute?
  • log4net write single file for each call to log.info
  • Free memory of cv::Mat loaded using FileStorage API
  • Getting error when using KSoap library to consume .NET web services
  • Java static initializers and reflection
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]