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

113
Visualizações
how to get info about page loading from server

Many times I've seen live progress bars indicating amount of data loaded from heavy-data web apps notifying users about loading process (% or filling bars) before page started rendering. How can it be implemented?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think that there is no perfect solution. And certainly not one correct answer. It mostly depends on the capabilities of the API/Server. I focussed on how to get the progress towards the frontend. And there i see three different types of data transfer.

❌ Timer (Worst solution) You can use a timer based on the average loading time. I don't think I have to explain why this is not a good solution. But this does not really give a correct loading state.

✔️ Polling You can use a polling system to retrieve the data. When the data is not ready yet you return the progress. If the data is ready, return the data. For example:

Step 1: GET the data from the REST-API
        This call returns an id linked to the request. F.e. ID-1

Step 2: You poll each couple of (mili)seconds the status of the request, based on the ID.
        This call returns for example:
          {
              status: 20,
              data: []
          }
        As soon as the status is 100, the data is provided

✔️ Web sockets Instead of polling you could also use sockets to update the frontend with the correct status. The server will publish the status towards the frontend. For this approach you will also need a certain type of ID to make sure you only receive your progress.

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