Patrioticcow
Patrioticcow

Reputation: 27058

does the number of ajax requests matter? how to?

i have a website that displays all kind 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 lease 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 is there is a limit or if is just bad to do it like this. In the same time i want the user experience t be the best.

Any ideas?

Upvotes: 0

Views: 103

Answers (1)

Kamyar Nazeri
Kamyar Nazeri

Reputation: 26514

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.

Upvotes: 1

Related Questions