Does PHP curl_reset () close the underlying connection?

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

I want to continue to use the same curl handle as it is much faster than closing it with curl_close() and getting new with curl_init() , because it keeps the underlying connection open. Reuse of the handle is definitely faster.

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

+5
source share
1 answer

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

... does not change the following information stored in the descriptor: live connections, session identifier cache, DNS cache, cookies, and shared resources.

+4
source

Source: https://habr.com/ru/post/1259863/


All Articles