Liam Liam - 3 months ago 16
PHP Question

Does PHP's curl_reset() close the underlying connection?

I am doing many curl requests to the same server in a loop.

I want to keep using the same curl handle, as this is much faster than closing it with

and getting a new one using
as it keeps the underlying connection open. Reusing the handle is definitely faster.

If I call
after each request, will this reset the connection and therefore slow down?


No. The curl_reset engine code calls the libcurl method curl_easy_reset whose documentation explicitly states:

... does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.