...

View Full Version : Speeding up PHP RSS retrieval



blue_harvester
02-04-2007, 11:47 PM
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?

meth
02-05-2007, 03:11 AM
Why not cache the content to a system file. Only request direct feeds if the cached file is more than 30mins old...

FJbrian
02-05-2007, 07:38 AM
http://www.jmagar.com

click on myheadlines
great great script

blue_harvester
02-05-2007, 10:20 AM
Why not cache the content to a system file. Only request direct feeds if the cached file is more than 30mins old...
But surely this would mean that there would always be one user that will have to wait 15 seconds?

gsnedders
02-05-2007, 12:00 PM
There's no way to avoid it the internet, by its very design, has latency. Caching will nearly irradiate the problem, and reduce the load on other servers.

blue_harvester
02-05-2007, 12:31 PM
There's no way to avoid it the internet, by its very design, has latency. Caching will nearly irradiate the problem, and reduce the load on other servers.
Someone else has suggested that I run a scheduled task every x minutes with cron to execute the php script and then store the resulting XML on the server? What are your thoughts on this?

FJbrian
02-05-2007, 11:21 PM
Someone else has suggested that I run a scheduled task every x minutes with cron to execute the php script and then store the resulting XML on the server? What are your thoughts on this?

the myheadlines I mentioned above will do that for ya, it's free too



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum