Forum Moderators: coopster
Just loading each URL will take a second or two, which is 400 seconds in total, already enough to make PHP time out. One solution to the problem would be to increase the time out value, but that would be a short-term fix. As I need to check more and more URLs, that solution becomes less viable.
All the URLs are stored in a database, so I could check each of them and then set a 'last checked' flag or something similar. The only problem is that I'd like the script to run through all of the entries automatically, without any intervention from me. Would the best way to do this be to have the script check 20 URLs every time it's run and have it called from a cron every 5 minutes? Or is there a more elegant way to get them all to run directly after one another, possibly by using session variables?
Any help/insight would be much appreciated!
I would go the route you mentioned
use a cron
have a last_checked or something similar
select a manageable number of urls - 20 sounds good, 50 might work too, it depends on how much you are doing
check those and then set the last_checked col
you will just have to figure out how often they need to be checked and then figure out your select logic and timing of the cron