我在循环中对同一台服务器做了很多curl请求。
我想继续使用相同的curl句柄,因为这比使用curl_close()
关闭它并使用curl_init()
获取一个新的快得多,因为它保持底层连接打开。重复使用句柄肯定更快。
如果我在每次请求后拨打curl_reset()
,这会重置连接,从而减慢速度吗?
答案 0 :(得分:5)
没有。 curl_reset
engine code调用libcurl方法<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select name="job_title" id="job_title">
<option selected disabled hidden style='display: none' value=''></option>
<option id="Superintendent" value="Superintendent">Superintendent</option>
<option id="Assistant-Superintendent" value="Assistant Superintendent">Assistant Superintendent</option>
<option id="Principal" value="Principal">Principal</option>
<option id="Vice-Principal" value="Vice Principal">Vice Principal</option>
<option id="Counselor" data-auth="need-purchase-auth" value="Counselor">Counselor</option>
<option id="Testing-Coordinator" data-auth="need-purchase-auth" value="Testing Coordinator">Testing Coordinator</option>
<option id="Curriculum-Director" data-auth="need-purchase-auth" value="Curriculum Director">Curriculum Director</option>
<option id="Administrator" data-auth="need-purchase-auth" value="Administrator">Administrator</option>
<option id="Teacher" data-auth="need-purchase-auth" value="Teacher">Teacher</option>
<option id="Parent" data-auth="need-purchase-auth" value="Parent">Parent</option>
<option id="Student" data-auth="need-purchase-auth" value="Student">Student</option>
</select>
<div id="authorized_to_purchase_box">
authorized_to_purchase_box
</div>
,其documentation明确说明:
...不会更改句柄中保留的以下信息:实时连接,会话ID缓存,DNS缓存,Cookie和共享。