What exactly does FORBID_REUSE
do in libcurl, specifically in the PHP implementation of CURL if there is any difference. I found documentation for it here: http://scriptbasic.com/html/texi/mod_curl/mod_curl_3.46.html, but that really doesn't help too much. It just says "if you don't know what you're doing, don't use it."
Well, I'd like to know what I'm doing.
curl_easy_setopt(3) is used to tell libcurl how to behave. By setting the appropriate options, the application can change libcurl's behavior. All options are set with an option followed by a parameter.
When setting up connections to sites, curl keeps old connections around for a while so that if the next transfer is done using the same host as a previous transfer, it can reuse the same connection again and thus save a lot of time. We call this persistent connections.
From the official documentation:
TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
Usually, multiple HTTP requests to the same web server are sent sequentially on the same TCP connection. This option disables that and makes curl open a new TCP connection for each HTTP request, presumably to deal with broken HTTP servers.
TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
In my experience -- I've never had to use it. It's a step to preventing caching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With