Page 1 of 1

background process

Posted: Sun Sep 25, 2005 2:25 am
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,

Posted: Sun Sep 25, 2005 3:08 am
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.

Posted: Sun Sep 25, 2005 12:03 pm
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.

Posted: Sun Sep 25, 2005 12:17 pm
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.