Hi, just a general question uncertain.
I am reading a rss feed from my blog, displaying the topics on index page. But then my index page takes longer to load? why?
Just thinking can AJAX help?
My original design was to display the topics on a pop-out layer when user clicks a button.
Please give some general advice to avoid the time on loading. Thanks
Why RSS runs slowly?
Moderator: General Moderators
Re: Why RSS runs slowly?
Is it pulling the feed from a remote server, your database or from a cache?
Re: Why RSS runs slowly?
I think my code reads from the remote server, e.g. bbc server.
Time maybe spent on loading data from it.
If not possible to reduce the time can I write a loading bar or similar to tell user when the loading finishes ?
Time maybe spent on loading data from it.
If not possible to reduce the time can I write a loading bar or similar to tell user when the loading finishes ?
Re: Why RSS runs slowly?
It would probably be easiest for you to save the feeds locally and serve them from your server. You can refresh them every 10 minutes or so.
Re: Why RSS runs slowly?
This is the code I called when the button on index page is clicked. Is this called locally?
Code: Select all
function writePost(){
$myMsnRss = 'http://morris520blog.spaces.live.com/feed.rss';
//$titleArray[] = array();
$doc = new DOMDocument;
$doc->load($myMsnRss);
for($i=1;$i<=$doc->getElementsByTagName('title')->length;$i++)
{
$topic = $doc->getElementsByTagName('title');
$link = $doc->getElementsByTagName('link');
$titleArray[$topic->item($i)->nodeValue] = $link->item($i)->nodeValue;
//echo 'content: '.$topic->item($i)->nodeValue."<br/>";
}
return $titleArray;
}