I have a web site that displays all kinds of info to the client. It has a chat, a different kind of chat, a couple of notifications, etc.
The way I build this is that every ajax call, for each of the chat and notification, happens every second. So at any given point I have at least 5 requests happening.
For example, the chat has to look alive, if there is a email notification I want to show it when it happens, if there is a friend request I want to show it right then.
Everything looks ok so far, but I am wondering if there is a limit or if is just bad to do it like this. In the same time I want the user experience to be the best.
Any ideas?
It does, if you really make concurrent calls and if the concurrency really matters to you!
Limited number of concurrent requests are allowed per domain in any browser, you can read more here, if you overuse it, there is the possibility your requests will be blocked waiting for others to complete! However if it doesn't concern you the browser will make the queue of requests and send it to the server whenever it is free.