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 7178929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:01:33+00:00 2026-05-28T17:01:33+00:00

Well I dont know which is the most efficient way to do. Could someone

  • 0

Well I dont know which is the most efficient way to do. Could someone help me in finding out a better algorithm.

okay let us take some example like facebook when user posts a post, it will be updated to his friend without any page refresh and we know its by ajax request . But how can we know that some one has posted a new thing? may be like putting a timer for every 2 seconds and sending an ajax request for some table and checking if some user posted something.right? but is there a way to do without setting a timer because performing the operation for every 2 seconds may cause severe server issue i think so ? just wanna know if there is a better way instead of setting a timer?

Any help is greatly appreciated.

  • 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-28T17:01:34+00:00Added an answer on May 28, 2026 at 5:01 pm

    Currently what Facebook and Google employ, is a technique called long polling.

    It’s a simple system whereby the client makes an AJAX request to the server. The server takes the request and checks to see if it has the data the request needs. If not, the request is left open but deferred by the server. The second the server has the data, the request is handled and returned to the client.

    If you open up facebook, you’ll see requests being posted to Facebook which take around 55 seconds to complete. Same goes for Gmail and a few other web applications that seem to have some kind of push system.

    Here’s a simple example of how these requests might be handled:

    1. Client:

      • Initial AJAX request which has the timestamp 0
    2. Server:

      • Compare request with timestamp 0 by checking the timestamp of the data on the server. Lets say the data on the server has the timestamp 234.
      • The client stamp is different from the current stamp on the server data so we return with the new data.
    3. Client:

      • Client gets the data and immediately posts a new AJAX request with timestamp 234.
      • Then we process the new data and update the web page appropriately.
    4. Server:

      • Compares request with timestamp 234 with the current stamp of the data on the server.
      • The stamp values are the same so we go to sleep.
      • Server data is update and stamp value is now timestamp 235.
      • Sleeping requests are woken up and returned with update value.

    You can read a more in-depth explanation of more modern mechanisms for live updates.

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

Sidebar

Related Questions

I dont know how to describe it well, but i will try. Ok, i
Alright, i dont know how to explain it well.. but i have a switch
Well i need some help here i don't know how to solve this problem.
I don't know if this is a well known 'thing' or something new in
Maybe I just don't know .NET well enough yet, but I have yet to
Well, I don't know if I'm completely wrong, but I really can't find a
Well, I don't know if strong naming is the right term, but what I
I'm new to python so I really don't know the language very well. the
A Java version of this question was just answered, and, well, I don't know
^([0-9]*[1-9][0-9]*(\.[0-9]+)?|[0]+\.[0-9]*[1-9][0-9]*)$ I don't know regular expression well. Above regular expression does not allow input

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.