Performance: reuse cURL connections
Created by: ewandennis
This PR holds a cURL session open so it can reuse connections. The effect is to amortise connection setup cost across HTTP requests to the same host.
Changes:
- renamed cURL session var
$chto$curl_session - moved
$curl_sessioninto a static class variable (self::$curl_session) - Conditionally create
$curl_sessionon first use - Remove call to
curl_close()to enable session reuse - Call
sparkpost_log()to report on total call time for each request