Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

313
Vistas
PHP CURL response time bypass

I have an CURL request, where at times, and also depending on the request load, it takes minutes to receive response from the API, due to processing and calculations.

For sake of good user experience, this behavior is undesired to have. While waiting for response, sometimes long time, user is unable to perform any functions on the website.

So I am looking for solutions on how to go by doing it so the user can use the application while this application waits for results from API.

Solutions I have already considered.

  1. Recording the request and using cron job to process it. Unfortunately there is couple of pitfalls to that. -Need of running a cron job every minute or constantly. -Situations when user request is minimal or API is super fast at the moment, entire request may only take 2-3 seconds. But when using cron and it was requested let's say 30 seconds ahead of time for next cron job run, you end up with result of 32 second turn around. So this solution may improve some, and worsen some, not sure if I really like that.

  2. Aborting CURL request after few seconds. Although the API sends separate response to url endpoint of my choice, and it seems safe to terminate transmission after posting request, there might be situation when those few seconds may not be enough time to even establish the connection with API. I guess what I am trying to say is that, with terminating CURL I have no way of knowing if the actual request made it through.

Is there another approach that I could consider? Thank you.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Sounds like what you're asking for is an asynchronous cURL call.

Here's the curl_multi_init documentation

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda