Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1100293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:51:28+00:00 2026-05-17T00:51:28+00:00

I’m already tossing around a solution but as I haven’t done something like this

  • 0

I’m already tossing around a solution but as I haven’t done something like this before I wanted to check what SO thought before implementation.

Basically I need to modify an existing web based application that has approximately 20 users to add push notifications. It is important that the users get the notifications at the same time (PC-A shouldn’t get an alert 20 seconds before PC-B). Currently the system works off of AJAX requests, sending to the server every 20 seconds and requesting any updates and completely rebuilding the table of data each time (even if data hasn’t changed). This seems really sloppy so there’s two methods I’ve come up with.

  1. Don’t break the connection from server-client. This idea I’m tossing around involves keeping the connection between server and client active the entire time. Bandwidth isn’t really an issue with any solution as this is in an internal network for only approximately 20 people. With this solution the server could push Javascript to the client whenever there’s an update and modify the table of data accordingly. Again, it’s very important that every connected PC receives the updates as close to the same time as possible. The main drawback to this is my experience, I’ve never done it before so I’m not sure how well it’d work or if it’s just generally a bad idea.

  2. Continue with the AJAX request, but only respond in intervals. A second solution I’ve thought of would be to allow the clients to make AJAX requests as per usual (currently every 20 seconds) but have the server only respond in 30 second intervals (eg 2:00:00 and 2:00:30 regardless of how many AJAX requests it recieves in that span of time). This would require adjusting the timeout for the AJAX request to prevent the request timing out, but it sounds okay in theory, at least to me.

This is for an internal network only, so bandwidth isn’t the primary concern, more so that the notification is received as close to each other as possible. I’m open to other ideas, those are just the two that I have thought of so far.

Edit

Primarily looking for pros and cons of each approach. DashK has another interesting approach but I’m wondering if anyone has experience with any of these methods and can attest to the strengths and weaknesses of each approach, or possibly another method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:51:29+00:00Added an answer on May 17, 2026 at 12:51 am

    How about using an XMPP server to solve the problem?

    Originally designed to be an Instant Messaging platform, XMPP is a messaging protocol that enables users in the system to exchange messages. (There’s more to this – But let’s keep it simple.)

    Let’s simplify the scenario a little bit. Imagine the following:

    You’re a system admin. When the system
    has a problem, you need to let all the
    employees, about 20 of them, know that
    the system is down.

    In the old days, every employee will
    ask you, “Is the system up?” every
    hour or so, and you’ll response
    passively. While this works, you are
    overloaded – Not by fixing system
    outage, but by 20 people asking for
    system status every hour.

    Now, AIM is invented! Since every
    employee has access to AIM, you
    thought, “Hey, how about having every
    single one of them join a ‘System
    Status’ chat room, and I’ll just send
    a message to the room when the system
    is down (or is back)?” By doing so,
    employees who are interested in
    knowing system status will simply join
    the ‘System Status’ room, and will be
    notified of system status update.

    Back to the problem we’re trying to solve…

    • System admin = “System” who wants to notify the web app users.
    • Employees = Web app users who wants to receive notification.
    • System Status chat room = Still, system Status chat room

    When web app user signs on to your web app, make the page automatically logs them onto the XMPP server, and join the system status chat room.

    When system wants to notify the user, write code to logon to the XMPP server, join the chat room, and broadcast a message to the room.

    By using XMPP, you don’t have to worry about:

    • Setting up “Lasting connection” – Some open source XMPP server, eJabberd/OpenFire, has built-in support for BOSH, XMPP’s implementation of the Comet model.
    • How the message is delivered

    You however will need the following:

    • Find a Javascript library that can help you to logon to an XMPP server. (Just Google. There’re a lot.)
    • Find a XMPP library for the server-side code. (XMPP library exists for both Java & C#. But I’m not sure what system you’re using behind the scene.)
    • Manually provision each user on the XMPP server (Seems like you only have 20 people. That should be easy – However, if the group grows bigger, you may want to perform auto-provisioning – Which is achievable through client-side Javascript XMPP library.)

    As far as long-lasting AJAX calls, this implementation is limited by the at-most-2-connection-to-the-same-domain issue. If you used up one connection for this XMPP call, you only have 1 more connection to perform other AJAX calls in the web-app. Depending on how complex your webapp is, this may or may not be desirable, since if 2 AJAX calls have already been made, any subsequent AJAX call will have to wait until one of the AJAX pipeline freed up, which may cause “slowness” on your app.

    You can fix this by converting all AJAX calls into XMPP messages, and have a bot-like user on the server to listen to those messages, and response to it by, say, sending back HTML snippets/JSON objects with the data. This however might be too much for what you’re trying to achieve.

    Ahh. Hope this makes sense… or not. :p

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.