【问题标题】:Will PHP's CURL ever reuse connection for curl requests of different handles?PHP 的 CURL 是否会为不同句柄的 curl 请求重用连接?
【发布时间】:2015-07-24 05:37:53
【问题描述】:
  • 假定讨论请求连接到同一目标主机
  • "handles" -> 我的意思是 curl_init() 的返回
  • 即使来自 CURLOPT_FORBID_REUSE 选项的文档也没有提及如果未设置该选项,是否会在不同的 curl 句柄之间发生连接重用。

我搜索了很多,甚至 CURL 的官方常见问题解答,但找不到明确的答案。

备注:与问题Reusing the same curl handle. Big performance increase?相关,但接受的答案没有明确回答,也没有官方参考。

【问题讨论】:

  • 也许这会回答你的问题:curl.haxx.se/docs/faq.html#What_about_Keep_Alive_or_persistcurl and libcurl have excellent support for persistent connections when transferring several files from the same server. Curl will attempt to reuse connections for all URLs specified on the same command line/config file, and libcurl will reuse connections for all transfers that are made using the same libcurl handle.
  • @blubear 谢谢。请使它成为一个答案。所以我认为答案是否定的。

标签: php curl


【解决方案1】:

也许这会回答你的问题:

curl.haxx.se/docs/faq.html#What_about_Keep_Alive_or_persist

curl and libcurl have excellent support for persistent connections when
transferring several files from the same server. Curl will attempt to reuse
connections for all URLs specified on the same command line/config file, and 
libcurl will reuse connections for all transfers that are made using the same 
libcurl handle.

【讨论】:

  • 换句话说,“否”。从上面看,它们必须是“相同的 libcurl 句柄”
猜你喜欢
  • 1970-01-01
  • 2020-02-15
  • 2017-08-03
  • 1970-01-01
  • 2014-11-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多