is it possible that loading an xml is slowing down my site?
I’ve written this little function in php to iterate over an array of Strings to calculate the total amount of my followers
function getFeedCount() {
foreach ($array as $value) {
$xml = simplexml_load_file("http://api.feedburner.com/awareness/1.0/GetFeedData?uri=$value")
or die ("Unable to load XML file!");
$circulation += $xml->feed->entry['circulation'];
}
return $circulation;
}
the array is about 10 items big and since I started using it, it really slowed down my site.
What could I do fix this issue.
Loading the data from feedburner will be what’s causing this: every time someone views your page it has to make 10 requests to the feedburner server for the feeds before it can return any data to your visitor.
Probably the best way round this is to cache the feedburner feeds to your server periodically and read the cached copies in the page generation.