I am working on building an ajax based messaging system. The idea is that client will call server every X number of seconds to get latest messages and some other crucial information. The application depends very heavily on this data being delivered to client. I have tested it on all kinds of connections and everything seems to be working perfectly. During one demo testing run, we observed that some clients were showing "undefined" text at places where the information from server supposed to be shown. That kind of tells me that server response is chopped or things like that which caused java script to choke.
There seems to be only thing common amongst clients who have reported the issue is that they are behind slow connection. And about 20 browsers were open on dozen different machines and all using same switch.
Bottom line is that it seems to be issue with clients with very slow connectivity. I have set the time out for the AJAX call to match the frequency at which these requests are sent. For now this time out and timer for sending calls is 5 seconds. The response payload is only 150-160 bytes.
Assuming that this is issue with slow connection and timeout, what would be best practice and strategy to deal this kind of situation?
Thanks