在观察了一段时间后,我的博客启用全站HTTP/2
关于HTTP2和其它几个协议的性能比价可以看这篇文章:http://www.infoq.com/cn/news/2015/02/https-spdy-http2-comparison/
启用方法,在Nginx 1.9.x以上版本,在listen 后面加http2,然后reload即可
在观察了一段时间后,我的博客启用全站HTTP/2
关于HTTP2和其它几个协议的性能比价可以看这篇文章:http://www.infoq.com/cn/news/2015/02/https-spdy-http2-comparison/
启用方法,在Nginx 1.9.x以上版本,在listen 后面加http2,然后reload即可
在Curl中我们有些时候需要将cookies字符串转换为数组,可以用下面的方法
public function setCookieString($string)
{
$result = array();
if(preg_match_all('/\s*([^;=]+)=([^;]+)/i',$string,$matches) > 0){
if(isset($matches[1]) && isset($matches[2])){
if(count($matches[1]) == count($matches[2])){
foreach ($matches[1] as $handle => $key) {
$result[$key] = $matches[2][$handle];
}
}
}
}
return $result;
}
参数只能放cookies字符串,如下图绿色框的部分
tmc=1.170236450.59236819.1462889961066.1462889961066.1462889961066; tma=170236450.72078710.1438771475412.1449463856228.1449536313927.12; tmd=202.170236450.72078710.1438771475412.