3
我正在使用Zend_HTTP_Client向服务器发送HTTP请求并获取响应。我发送请求的服务器是HTTPS Web服务器。目前,一个往返请求需要大约10-12秒。我了解,开销可能是因为请求发送到的Web服务器处理缓慢。跳过SSL签入Zend_HTTP_Client
是否可以像CURL中那样跳过SSL证书检查来加速性能?如果是这样,如何设置这些参数?
我有以下代码:
try
{
$desturl ="https://1.2.3.4/api";
// Instantiate our client object
$http = new Zend_Http_Client();
// Set the URI to a POST data processor
$http->setUri($desturl);
// Set the POST Data
$http->setRawData($postdata);
//Set Config
$http->setConfig(array('persistent'=>true));
// Make the HTTP POST request and save the HTTP response
$httpResponse = $http->request('POST');
}
catch (Zend_Exception $e)
{
$httpResponse = "";
}
if($httpResponse!="")
{
$httpResponse = $httpResponse->getBody();
}
//Return the body of HTTTP Response
return $httpResponse;
您猜测性能问题可能是什么?为什么不确定? – 2010-07-30 00:17:34