I have a project that needs to fetch data from an XML API, I'm using php's cUrl to get the data from the API. Now the data download is as follows
- 1 request to fetch data, 123kb file
- 1 request to get data specific info 600 bytes file
- 1..10 request to get images (max 170kb files)
In that order and nested from bottom to top, the data obtained is a school, an activity calendar and an image gallery
So you see, there are 12 curl request top
I have debugged my application logic, and the delay once the data is on memory to perform the operations is 3 secs.
The timing obtained by curl_getinfo is as follows
{
"url":"the url",
"content_type":"text\/xml; charset=iso-8859-1",
"http_code":200,
"header_size":222,
"request_size":600,
"filetime":-1,
"ssl_verify_result":0,
"redirect_count":0,
"total_time":0.942642,
"namelookup_time":8.4e-5,
"connect_time":0.179581,
"pretransfer_time":0.17966,
"size_upload":326,
"size_download":12720,
"speed_download":13493,
"speed_upload":345,
"download_content_length":-1,
"upload_content_length":326,
"starttransfer_time":0.576183,
"redirect_time":0,
"redirect_url":"",
"primary_ip":"81.93.213.42",
"certinfo":[
],
"primary_port":80,
"local_ip":"192.169.233.75",
"local_port":43479
}
This data is encoded as json, because it will be putted on a log server.
So my question is why if curl takes 1s to get the response from the API and my logic is executed between 2 and 3 seconds the response has a time of 1 min, where are the next 50s???
One thing to notice is that my website runs on godaddy, a VPS under https and the api runs on HTTP, does this has anything to do?
Thanks in advance