Monday, 2 May 2016

php - How much bandwidth do I generate to destination web site with my curl code?



I use this function to load some source from another web site.




function getWebPageSourceCurl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
$content = curl_exec($ch);
curl_close($ch);
return $content;
}


How much bandwidth do I generate to destination web site? When I call this function does server also load images or just source code.


Answer



This will only load the $url (presumably just the static/dynamic outputted HTML) specified, the amount of bandwidth will depend entirely on how big the page is. It's impossible to say.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...