Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Speeding up PHP RSS retrieval

    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?

  • #2
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Why not cache the content to a system file. Only request direct feeds if the cached file is more than 30mins old...
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Adirondacks
    Posts
    516
    Thanks
    4
    Thanked 4 Times in 4 Posts
    http://www.jmagar.com

    click on myheadlines
    great great script

  • #4
    New Coder
    Join Date
    Jan 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by meth View Post
    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?

  • #5
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    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.

  • #6
    New Coder
    Join Date
    Jan 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Error 404 View Post
    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?

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Adirondacks
    Posts
    516
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by blue_harvester View Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •