Note that there are some explanatory texts on larger screens.

plurals
  1. POReally long starttransfer_time over curl
    primarykey
    data
    text
    <p>I'm racking my brain trying to figure out why I'm getting such long start transfer times when using curl to get the content of a page on the same domain. </p> <p><a href="http://dragon.pbndev.net/?rah_external_output=team_pages" rel="nofollow">http://dragon.pbndev.net/?rah_external_output=team_pages</a>. Getting this page in my browser the response is ~200ms, same page over curl my starttransfer_time is ~16 seconds.</p> <p>If I switch the below to say <a href="https://www.google.com" rel="nofollow">https://www.google.com</a> I can get the response really fast, just about the same as if I hit the target url in my browser.</p> <p>Lots of these options I picked up from other "my curl requests are not working" questions here. I just can't figure out why the response time is so long.</p> <p>I've also tried the same url above with <code>file_get_contents()</code> and I get an empty response.</p> <pre><code>$ch = curl_init(); $getTemplateFromDomain = 'http://dragon.pbndev.net/?rah_external_output=team_pages'; curl_setopt($ch, CURLOPT_URL, $getTemplateFromDomain); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); curl_setopt($ch, CURLOPT_TIMEOUT, 25); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $response = curl_exec($ch); $errStr = curl_error($ch); $errNum = curl_errno($ch); $head = curl_getinfo($ch, CURLINFO_HEADER_OUT); $ci = curl_getinfo($ch); var_dump(array('head' =&gt; $head, 'error_string' =&gt; $errStr, 'error_number' =&gt; $errNum, 'curl_info' =&gt; $ci, 'response' =&gt; $response)); </code></pre> <p>This is the response I get from the var_dump, SO i can get the content, it just take a very long time.</p> <pre><code>array (size=5) 'head' =&gt; boolean false 'error_string' =&gt; string '' (length=0) 'error_number' =&gt; int 0 'curl_info' =&gt; array (size=22) 'url' =&gt; string 'http://dragon.pbndev.net/?rah_external_output=team_pages' (length=56) 'content_type' =&gt; string 'text/plain; charset=utf-8' (length=25) 'http_code' =&gt; int 200 'header_size' =&gt; int 562 'request_size' =&gt; int 222 'filetime' =&gt; int -1 'ssl_verify_result' =&gt; int 0 'redirect_count' =&gt; int 0 'total_time' =&gt; float 16.195335 'namelookup_time' =&gt; float 0.001552 'connect_time' =&gt; float 0.001802 'pretransfer_time' =&gt; float 0.002 'size_upload' =&gt; float 0 'size_download' =&gt; float 7007 'speed_download' =&gt; float 432 'speed_upload' =&gt; float 0 'download_content_length' =&gt; float -1 'upload_content_length' =&gt; float 0 'starttransfer_time' =&gt; float 16.19518 'redirect_time' =&gt; float 0 'certinfo' =&gt; array (size=0) empty 'redirect_url' =&gt; string '' (length=0) 'response' =&gt; string '&lt;!doctype html&gt; &lt;!--[if lt IE 7]&gt; &lt;html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"&gt; &lt;![endif]--&gt; &lt;!--[if IE 7]&gt; &lt;html class="no-js lt-ie9 lt-ie8" lang="en"&gt; &lt;![endif]--&gt; &lt;!--[if IE 8]&gt; &lt;html class="no-js lt-ie9" lang="en"&gt; &lt;![endif]--&gt; &lt;!--[if gt IE 8]&gt;&lt;!--&gt; &lt;html class="no-js" lang="en"&gt; &lt;!--&lt;![endif]--&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="description" content="Lake Bemidji Dragon Boat Festival's website"&gt; &lt;meta name="keywords" content="Bemidji, Minne'... (length=7007) </code></pre> <p>Ultimately I'm going to cache the result in memcache so I don't have to get it very time, but I'd like to figure out why it's taking so long in the first place.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload