Reputation: 291
Currently I am calling a PHP script every 500 milliseconds (I want it to be a "live" chat) to get the latest chat messages and place them in the widget on the website. It all works fine but I am wondering if there's a better way to handle the message retrieving. Something like a callback when someone posts a message and only then ask PHP for new chat results.
Am I doing it the right way or are there better options.
Thanks for helping!
Upvotes: 0
Views: 151
Reputation: 32748
Websockets and using something like http://pusher.com/ is a much better approach than "polling" for data.
Upvotes: 1