I'm a posting a cURL request, but somehow it is not that fast. It takes about 6 seconds to finish. Within the cURL, I am sending a base64_encoded small image. 64x64px.
It might not be the image which slows the cURL, but something else. Here is the setup:
$url = 'the_URL';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
$json_response = curl_exec($curl);
This is the result:
Array (
[url] => the_URL?
[content_type] => application/json
[http_code] => 200
[header_size] => 441
[request_size] => 165
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 5.665052
[namelookup_time] => 2.2E-5
[connect_time] => 0.027501
[pretransfer_time] => 0.091433
[size_upload] => 204303
[size_download] => 1149
[speed_download] => 202
[speed_upload] => 36063
[download_content_length] => 1149
[upload_content_length] => 204303
[starttransfer_time] => 0.120824
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => IP
[certinfo] => Array ( )
)
I think 6 seconds is two slow for a cURL like this.
Do I miss something in my setup?
UPDATE!
No sorry. The file is in a zip, and the zip is base64_encoded. My bad. Today it took like 19 seconds to do the cURL execute.
Unfortunately the function curl_setopt($curl , CURLOPT_IPRESOLVE , CURL_IPRESOLVE_V4);
didn't help at all.
There are two images in the zip. They are both 25kb... So it might not be the thing.
Any other suggestions?