background process

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nileshkamani
Forum Newbie
Posts: 1
Joined: Sun Sep 25, 2005 2:18 am

background process

Post by nileshkamani »

Hello Friends,

I really need your help to improve my website.
I am running one news portal with using rss feeds.
now how the script is currently working -->
when anyone opens the website, the script retrive the RSS feed from one newswebsite,
convert the rss feed into text file, and then display this text file as scroll.

but the page is downloading very slow..

i want such a script that update the text file once in an hour..
how can i do this?
how can i make any php script which runs in background?


Waiting for your answers.

Regards,
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Have a cron job to run a php script that'll download the rss file every one hour.
Adding a cron job is pretty simple if you add it using a common control panel like Cpanel, Plesk etc.
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post by Trenchant »

another thing you could do is have your users do it. Just have the script check what time it is and when the last news role was loaded. If the news was loaded over an hour ago then load it.

Thats an alternative if you don't have crons. If you don't then I'll give you a better description of what I mean.
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

That's what I'm using.

This is a very good replacement to cron jobs, (maybe the only one).
However consider that the only disadvantage is more processing time for your script.
Post Reply