CURL with PHP - Very slow

jbqxzjac

New Member
All,I have to request a URL which returns a JSON request. I am using PHP and CURL to do this. Currently it takes around 3-4 seconds for the request and response. Following is the curl code\[code\] $ch = curl_init(); $devnull = fopen('/tmp/curlcookie.txt', 'w'); curl_setopt($ch, CURLOPT_STDERR, $devnull); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $desturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $ret = curl_exec($ch); curl_close($ch); if ($devnull) { fclose($devnull); }\[/code\]Following is the CURL_GETINFO array\[code\]Array( => https://xx.xx.xxx.xx/portalsite...an I speed up the CURL processing time?Thanks
 
Top