View Full Version : cron.php - What does it do on page load?
josh_krz
08-22-2012, 01:04 PM
Hello, I have run my forums on pingdom tools and noticed that the cron.php file in itself takes 300ms to complete what ever it does.
What does this do on pageload? Can I disable it or optimise it in any way so that my page loads snappier?
Thank you.
cron.php runs your scheduled tasks, so what it does on a given page load and how long it takes will vary depending on what's running. It's done by putting a fake image at the bottom of the page, so I don't think it should affect what the user sees, as far as page load time. Also, on a busy forum it probably won't be doing anything most of the time.
josh_krz
08-23-2012, 02:34 PM
cron.php runs your scheduled tasks, so what it does on a given page load and how long it takes will vary depending on what's running. It's done by putting a fake image at the bottom of the page, so I don't think it should affect what the user sees, as far as page load time. Also, on a busy forum it probably won't be doing anything most of the time.
So would you say it isn't safe to delete it? See I thought scheduled tasks run server side at given intervals?
The 400ms would make my forums a lot faster.
No, you don't want to delete it, some things won't work right if you do. The scheduled tasks do run on the server, but vb has no way to force anything to run except when a page request comes in (in theory you could use a cron job or equivalent, but it's not set up that way by default).
I'm not an expert on analyzing page load times, but like I mentioned above, it might show up on a graph as something taking a long time, but it shouldn't look that way to the user because they won't notice if it's done or not. But also, it doesn't seem like it should take 400ms every time. Did you run more than one test and see that every time?
josh_krz
08-23-2012, 02:50 PM
No, you don't want to delete it, some things won't work right if you do. The scheduled tasks do run on the server, but vb has no way to force anything to run except when a page request comes in (in theory you could use a cron job or equivalent, but it's not set up that way by default).
I'm not an expert on analyzing page load times, but like I mentioned above, it might show up on a graph as something taking a long time, but it shouldn't look that way to the user because they won't notice if it's done or not. But also, it doesn't seem like it should take 400ms every time. Did you run more than one test and see that every time?
I have ran a few tests, the quickest it has taken was about 200ms and the longest was about 500ms.
So the "server side" cron jobs are activated by page loads? I suppose that makes sense.
I think I will just leave it for now and focus on optimising other areas. Thank you for your help.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.