Jump to content

ajax heartbeat question


Recommended Posts

so im working on this chat app for a sit im working on .. the main feature is a 3 room tabbed chat window each room displays the chat text and the users in the room but this is not my issue as its working as intended.


my issue is we are adding group and user chat where a user can start a group room and chat with users they add and we want to use 1on1 user chats ... the question is should i use a separate hartbeat for each chat div or have 1 update them all?

Link to comment
Share on other sites

Have a single request to the server for your updates. Format the output of the request in such a way that you can pass all the relevant information for each tab (and anything else) into a single response and then have your JS update things as necessary.


Trying to manage several update requests is going to get messy quickly when you start having a bunch of chat tabs open, you may also hit browser limits causing things to slow down. Browsers generally limit the number of concurrent requests to a given domain to 2, further requests are queued. There may also be a cap on the number of concurrent requests one can make regardless of the destination domain.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.