【发布时间】:2011-03-23 00:37:57
【问题描述】:
我正在使用 Zend_HTTP_Client 向服务器发送 HTTP 请求并获得响应。我向其发送请求的服务器是 HTTPS Web 服务器。目前,一个往返请求大约需要 10-12 秒。我知道开销可能是因为请求所到达的 Web 服务器的处理速度很慢。
是否可以像在 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;
【问题讨论】:
-
您猜到性能问题可能是什么?为什么不能确定呢?
标签: php zend-framework ssl curl https