Saturday, 14 September 2013

Asynchronous chat

Asynchronous chat

I was following a PHP-MySQL shoutbox tutorial that covered just sending
and storing messages in the database. After I finished it, temporarily I
chose to refresh the list of messages every 5 seconds or every time you
send a new one using AJAX. But this would be too inefficient and server
consuming(practically a low-intensity DDOS) in real life applications. So
how do I refresh the list of new messages just when necessary? More
precisely, how do I get notified that a new message was sent exactly when
this happens so that I can display it?

No comments:

Post a Comment