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

  • SEARCH
  • Home
  • 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 1019505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:01:25+00:00 2026-05-16T11:01:25+00:00

What are some good practices for polling a server with JavaScript for an application

  • 0

What are some good practices for polling a server with JavaScript for
an application that needs to refresh data very rapidly? I’m using jQuery for front-end and Java Spring Framework for backend.

Example of refreshed data could be list of items that are getting updated very rapidly (every 1 second).

  • 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-16T11:01:25+00:00Added an answer on May 16, 2026 at 11:01 am

    You may want to use jQuery’s Ajax functions to poll the server every second or so. Then the server can respond with instructions to the browser in near real-time.

    You can also consider long polling instead of the above, to reduce the latency without increasing the frequency of the polls.

    Quoting Comet Daily: The Long-Polling Technique:

    The long-polling Comet technique is a technique that optimizes traditional polling to reduce latency.

    Traditional polling sends an XMLHttpRequest to the server in fixed intervals. For example, open a new XMLHttpRequest every 15 seconds, receive an immediate response, and close the connection.

    Long-polling sends a request to the server, but a response is not returned to the client until one is available. As soon as the connection is closed, either due to a response being received by the client or if a request times out, a new connection is initiated. The result is a significant reduction in latency because the server usually has a connection established when it is ready to return information to return to the client.

    In addition to the above, I also suggest that you check out the accepted answer to the following Stack Overflow post for a detailed description of the long polling technique:

    • How does facebook, gmail send the real time notification?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are some good resources to learn best practices for Javascript? I'm mainly concerned
Can you suggest some good Javascript assignments/homework to C programmers , who are not
Are there some good tools that can analyze the performance issues in an asp.net
Can anyone suggest some good resources, preferrably free, that I can read to thoroughly
I realize that the phrase good practices is a bit dubious and overused, but
What are some good practices to control the memory you block up with VBA.
I'm new to Objective-c and after having read some articles about good practices, it
I'm currently polling my CFReadStream for new data with CFReadStreamHasBytesAvailable . (First, some background:
I could really use some good feedback on best practices / insight on whether
I'm looking for some good overviews of best practices and common patterns for enabling

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.