Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
How resource heavy is sending an AJAX request on a setTimeout() function?

I'm going to create a live chat system for my website, but I'm not sure how to go about it. My original plan was to have an AJAX request to get the chat log every X seconds, and that's what it seems a lot of tutorials have done.

However, I'm worried that by doing this, I might use up my server's resources unnecessarily, or very quickly. I want my chat to be quite accurate, so I guess my question is, what's the most appropriate time in milliseconds I should wait between each ping to not use up my server's resources while keeping my chat log accurate?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you want something powerfull, try to look into websockets. You can find some intuitive libraries like socket.io.

Otherwise it's ok to use ajax on a setTimeout and do some research about ajax polling wich is the best technology to use in that case.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!