![]() |
True Asynchronous Cron Jobs using Javascript [!AJAX]. No more hanging page loads.
How vB's Cron Jobs Work (and the problem with them)
vBulletin has a great, built-in scheduled task system. It relies on an invisible pixel image output on the bottom of the forum pages to run the scheduled tasks (cron jobs). It works like this: When a user visits a page, vB checks to see if there are any pending cron jobs to execute. If there are, the cron image is inserted at the bottom of the page. That image, instead of displaying a real image, actually calls the scheduled task script which first returns the image, then proceeds to execute the scheduled task. This setup can cause the page load to hang, depending on what browser you're using. vB goes to great lengths to send the content-length header, then flush the image data to the browser. This causes some browsers to stop loading the page even though the script isn't finished running (it has to execute the cron job), since the data returned matches the content-length header. However, not all browsers are that smart. Sometimes they sit there with whatever indicator they have spinning, saying the page is still loading, until the scheduled task has finished. How this product works, and how it fixes the problem This add-on fixes the problem. How it works: 1. First it checks to see if the user has Javascript enabled. No Javascript means the standard vB cron image is used, so your scheduled tasks keep running. 2. If Javascript is enabled, then a short snippet of Javascript is inserted at the bottom of the page instead of the cron image. 3. What this Javascript does is first wait until the page is completely loaded. After the page is loaded, it ask for the standard vB cron image, which runs your scheduled task. After the image is loaded, it displays it (it's invisible) at the bottom of the page. It's as simple as that. The advantage of this setup is that the cron image is requested via Javascript after the page is done loading, so that the user doesn't think something is wrong and wonder why the page won't finish loading. Installation Import the product XML via the Product Manager. You can enable/disable the product in the JS Cron Image Options group. Technical Specs This product adds one plugin which inserts Javascript where the vB cron image used to go. That's it. History Version 1.0.0 - Initial Release Version 1.0.1 - Better compatibility with vBa and other 'portal' scripts. $vbulletin->options['bburl'] is prepended to the cron image URL. This product doesn't change how cron jobs execute at all, it only requests the cron image (which starts cron job execution) in a different way, so that the user doesn't have forever-loading pages. If you use this, please click Mark As Installed. |
I like it installing now
|
i've installed and trying it out. looks nice
thanks |
so this speends up our forum or what
|
interesting
|
Quote:
|
works pretty..thank you . installed
|
installed
|
yea installed and works fine thanx
|
Excellent addition .. thanks Analogpoint
Clicked install :up: |
Very good.
But, will be there a conflict with the <body onload="bla bla bla">? Is it compatible with all browsers? especially IE6-7 FF1.5 FF2. |
When i refresh using Mozilla..it gives me a grey screen and then goes back to normal.Why is that?
|
Interesting share = Thanx ;)
Jacquii. |
<a href="https://vborg.vbsupport.ru/showthread.php?t=123719" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=123719</a>
|
Quote:
Quote:
Quote:
Quote:
|
was waiting for the above statement to install :)
Thanx for the share! Jacquii. |
ehm... to make it work under vbadvanced (i mean, the portal) i had to subst cron.php in the plugin with the full path to cron, or it was searching for cron in the root folder, obviously not finding it :)
btw, yes, this seems to speed up loading very much, thanks! |
would u plz someone explain how we should kno that it works or not ?? i mean where we can find any detail that how it works in our board and ... !!
thanks |
Quote:
Quote:
|
Quote:
|
I'll see how this update is when I install MK portal even though its not completely integrated with vBulletin.
|
THANKS Analogpoint
GReAT HACK |
Quote:
|
Time has teach me to wait for the second version :D
Great-must install! |
Quote:
Quote:
|
Noticeable improvement on page loading time. Much appreciated! Marked Installed...
|
What? I only see a XML to import, no files.
Quote:
|
Quote:
|
How about including what browsers do problems..
|
Quote:
p.s. JS Cron Image Options is Enabled Thanks |
Quote:
You can view any of all of your cron jobs |
Quote:
Quote:
|
Hey, Analog, How do we know it's working?
|
Quote:
|
Quote:
Admin Control Panel -> Scheduled Tasks (near the bottom) -> Scheduled Task Log. Quote:
I'll reiterate. This mod doesn't change how scheduled task run. It only changes how the cronimage is loaded into the footer of the site. |
yea i have many scheduled logs ! but i can not see any log for this mod in LOGS :(
|
Quote:
|
today i check the scheduled tasks and i saw the times r for 4 days before !! and next time running time was for 3days before !!
any idea ??? |
Quote:
|
I have a question.. is there any way to really tell if this actually improves loading times?.. Anyone actually test to see? And is it a more efficient hack for big boards?
thanks ahead of time |
All times are GMT. The time now is 06:21 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|