Like the Admin said,
[qoute]
Have you considered using a third party PHP parser? I know this isn't a solution to your problem, but I use MagpieRSS PHP parser and I absolutely love it.
[/quote]
you could use a third party PHP, RSS parser.
How this solves your loading problem is that most these third party RSS or XML parsers have an inbuilt caching system, that caches RSS feeds.H
(This is required in the RSS Specs).
When retrieving RSS feeds, many sites will not allow you to request a feed more than once within an hour.
If you want to cache RSS feeds yourself, you can use something like this file caching function I found on the web, when you retrieve the rss file.
[php]
// cache a (http) fopen - with cache-timeout.
function cached_fopen($file, $file_mode, $timeout_seconds = 600, $cache_path = "/tmp"){
$debug=false;
clearstatcache();
$cache_filename=$cache_path . "/" . urlencode($file) .".cached";
if ($debug) { print "local_cache creation_time =" . @filemtime($cache_filename) . " actual time = " . time() . " timeout = " . $timeout_seconds ."";}
if ( ( @file_exists($cache_filename ) and ( ( @filemtime($cache_filename) + $timeout_seconds) > ( time() ) ) ) ){
// ok, file is already cached and young enough
if ($debug) { print "using cached file ($cache_filename)
";}
}
else
{
if ($debug) { print "cacheing file ($file) to local ($cache_filename)
";}
// cache file from net to local
$f = fopen($file,"r");
$f2 = fopen($cache_filename,"w+");
while ($r=fread($f,8192) ) {
fwrite($f2,$r);
}
fclose($f2);
fclose($f);
}
// ok, point to (fresh) cached file
$handle = fopen($cache_filename, $file_mode);
return $handle;
}
[/php]
Whta the funciton does is first check if there is a local version of the file available and still "fresh", then gets it from the remote server if otherwise.
So for your RSS files, it will first check if it has a local version of your RSS file saved and within the timeout, otherwise, download the RSS file.
Hope that helps.