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