My site is taking ~45 seconds to load. It\'s because I\'m pulling in some XML from tumblr, but I can\'t figure out if this is my server\'s fault, tumblr\'s fault, or some other
You can also do in this way:
function simplexml_load_file_from_url($url, $timeout = 20){
$context = array('http' => array('timeout' => (int)$timeout));
$data = file_get_contents($url, false, stream_context_create($context));
if(!$data){
trigger_error('Cannot load data from url: ' . $url, E_USER_NOTICE);
return false;
}
return simplexml_load_string($data);
}