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

252
Vistas
Why does CURLOPT_IPRESOLVE speed up my requests so drastically?

I've been reworking part of one of my applications from AJAX to cURL and part of optimizing this new application flow was adding the CURLOPT_IPRESOLVE with protocol CURL_IPRESOLVE_V4. I ran some tests with and without this protocol and I noticed that the results got back to me approx. 5 times faster when using this protocol, making it by far the best optimization I added.

 curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

However, I'm puzzled at how this works. Can someone explain why setting the CURLOPT_IPRESOLVE option speeds up requests so drastically? From what I could find it has something to do with cURL's DNS resolvement.

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

0

The CURLOPT_IPRESOLVE option switches between IPv4, IPv6, or both.

My guess is that your system is technically capable of talking IPv6, but in practice has no active connection. So in the default configuration, curl is trying first to connect over IPv6, reaching a time limit, and falling back to IPv4. By forcing it to connect only over IPv4, you skip that initial attempt, speeding up the request.

An alternative explanation is that your system can connect over IPv6, but does so via a different network route, which for some reason is slower than the default IPv4 network.

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