Reputation: 2471
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.
Upvotes: 0
Views: 49
Reputation:
I would say chances are Facebook is using IRC. & I would go as far to say as most of the big web apps are using a some form of IRC for communication.
You should be able to find some good PHP IRC resources out there that will work a hell of alot better than periodic XHR through AJAX.
XHR is really intended to get one clump of info. continually blasting it like that for several people every minute or less I imagine would be agony for your server.
You wouldn't use curl and xml for a chat client maybe for support tickets chat client hell no.
Upvotes: 1