You can usually achieve what you want using WebSockets , however I don’t think Facebook supports a mechanism based on using WebSockets for their APIs, so there probably isn’t a solution that doesn’t include any kind of poll. However, you can transfer this polling mechanism from the user browser to your server, which will probably create a more convenient user interface and reduce the number of API calls that you must make to the Facebook API if there are speed limits.
In particular, I propose a mechanism in which you query the data from the Facebook API in your database, then configure a WebSockets solution, such as Socket.IO , which provides the data polled in the Facebook API using the event-driven WebSockets mechanism (i.e. much faster than polling) for the user of your site (Socket.IO returns to AJAX polling if the user's browser does not support WebSockets).
source share