Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda