I am designing a web based chat feature for an application that will work sort of like facebook chat or google talk inside of gmail. I'm wondering if anyone has any advice on how often it should check for updates? Every 2 seconds? Every 5 seconds? 10 seconds?
Also, should I call setTimeout in the callback function of setTimeout, or in the callback of the ajax request for updates? Basically, should it be n seconds between calls, or n seconds between the completion of the last request and start of the next?
Thanks