My website currently divides and displays messages in a conversation using PHP. I would like to implement jQuery into the messaging system and provide updates at intervals.
My biggest concern is bandwidth use. My workaround is to make a variable that stores a unix timestamp of the last message received from the sender. This variable will be sent to a script every x (lets say 30) seconds and the script will do a mysql count(*) for any records that have a newer timestamp than the one in the variable. If there is, another script would run to update the messages, if not it would simply keep checking at whatever intervals it is set to.
Can anyone provide any insight or suggestions while I start working on this? I really don’t want to go beyond php/jquery unless it doesn’t require a whole server.
I believe this tutorial will help you a lot.