I often find myself in the need to update the clients browser with the latest information of the server. To do this I typically perform a periodic XHR through ajax. It is not very responsive as it relies heavily on the interval. I am wondering if there are 'better' or more modern options.
Let's take the example of instant messaging. If you look at websites such as facebook, the messages are virtually immediately passed to the client. But I don't see any periodic XHR when checking the browser tools. So I am wondering what kind of technology big webapplications are using? How can they be so responsive? Is there any real 'push' mechanism?
I am already aware of technologies like Push API
and Web notifications
.
But these seem to be used for the built-in browser notifications.
I hope this question is not too broad. I have tried searching articles but nothing I could find was technical enough.