Speeding up PHP RSS retrieval

Associate
Joined
6 Dec 2002
Posts
661
Location
Belfast
I'm building a simple one page website that displays the top 10 stories of 9 different RSS feeds. I'm using PHP PEAR to retrieve the RSS feeds. When you first visit the site it takes approx 15 second to retrieve all feeds. This is clearly far too long to wait and therefore I need a way to have this data readily available when someone visits the site.

Any suggestions? Is it possible to have a PHP script that runs every 1 minute that will go off and retrieves the RSS feeds and saves them to an XML on the server. Then I could just grab the XML content with JavaScript?
 
Beansprout said:
Setup a script to do that, and use cron to run the script every X minutes :)
Could you please elaborate, I'm not too familiar with Unix. I assume that I'll be able to use this on my Linux hosting account? So what you're saying is that I can setup a script that executes the php that retrieves the RSS scripts so that the XML will be updated every x minutes?
 
Dj_Jestar said:
If it's taking "too long" to retrieve only 10 items, something else is wrong.

besides which.. 15 seconds once, every hour, for one person, is not the end of the world.
The reason it takes so long is because a number of the RSS feeds take a while to be retieved from the remote site; I've tried this in a browser by loading just the RSS XML and it takes maybe 3 or 4 seconds. When all 9 RSS feeds are being retrieved at once then this is the problem.

Also, the target audience for this site will not be prepared to wait 15 seconds when they first load the page. So therefore the information needs to be readily available.
 
Back
Top Bottom