Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
True Asynchronous Cron Jobs using Javascript [!AJAX]. No more hanging page loads. Details »
True Asynchronous Cron Jobs using Javascript [!AJAX]. No more hanging page loads.
Mod Version: 1.0.1, by Analogpoint (Member) Analogpoint is offline
Developer Last Online: Dec 2007 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.x Rating: (19 votes - 4.63 average) Installs: 175
Released: 18 Oct 2007 Last Update: 19 Oct 2007 Downloads: 693
Not Supported Uses Plugins  

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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #31  
Old 20 Oct 2007, 15:01
Tulsa Tulsa is offline
 
Join Date: Jul 2005
Originally Posted by Mecho View Post
i searched everywhere but i couldnt find anything ! would u plz tell me where exactly i have to look ?

p.s. JS Cron Image Options is Enabled

Thanks
Admincp > Statistics & Logs > Scheduled Task Log

You can view any of all of your cron jobs
Reply With Quote
  #32  
Old 20 Oct 2007, 15:03
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by BobbyBig View Post
How about including what browsers do problems..
I tested it in IE6, IE7, FF2, Opera9. It should work in *any* browser that runs Javascript. And remember, if Javascript is not available, it reverts back to the standard vB cronimage so your scheduled tasks continue to run.

Originally Posted by Mecho View Post
i searched everywhere but i couldnt find anything ! would u plz tell me where exactly i have to look ?

p.s. JS Cron Image Options is Enabled

Thanks
Admin Control Panel -> Scheduled Tasks (near the bottom) -> Scheduled Task Log.
__________________
My vBulletin Modifications.
Reply With Quote
  #33  
Old 20 Oct 2007, 15:04
Kihon Kata's Avatar
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Hey, Analog, How do we know it's working?
__________________
3MultiMedia.com - Simple, Effective CMS WebDesign
Reply With Quote
  #34  
Old 20 Oct 2007, 15:58
Mecho's Avatar
Mecho Mecho is offline
 
Join Date: Aug 2006
Originally Posted by Analogpoint View Post
Admin Control Panel -> Scheduled Tasks (near the bottom) -> Scheduled Task Log.
Thanks but i dunno y i can not see any log for this cron !!
Reply With Quote
  #35  
Old 20 Oct 2007, 16:18
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by Kihon Kata View Post
Hey, Analog, How do we know it's working?
Check your logs.

Admin Control Panel -> Scheduled Tasks (near the bottom) -> Scheduled Task Log.


Originally Posted by Mecho View Post
Thanks but i dunno y i can not see any log for this cron !!
Are there any logs for scheduled tasks from before installing this product? Do you have any scheduled tasks set up and enabled? Have you had any forum visitors? (if you don't your scheduled tasks won't run)

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.
__________________
My vBulletin Modifications.
Reply With Quote
  #36  
Old 23 Oct 2007, 15:14
Mecho's Avatar
Mecho Mecho is offline
 
Join Date: Aug 2006
yea i have many scheduled logs ! but i can not see any log for this mod in LOGS
Reply With Quote
  #37  
Old 23 Oct 2007, 19:41
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by Mecho View Post
yea i have many scheduled logs ! but i can not see any log for this mod in LOGS
There's no log for this mod. If your regular scheduled tasks are running, then this mod is doing it's job. This mod simply runs all your regular scheduled tasks, it just works better than the default vB cronimage.
__________________
My vBulletin Modifications.
Reply With Quote
  #38  
Old 24 Oct 2007, 13:59
Mecho's Avatar
Mecho Mecho is offline
 
Join Date: Aug 2006
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 ???
Reply With Quote
  #39  
Old 24 Oct 2007, 21:54
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by Mecho View Post
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 ???
If you don't have any forum visitors the scheduled tasks can't run. If you want to test it, disable this product, and the scheduled task log will look exactly like it does with it enabled.
__________________
My vBulletin Modifications.
Reply With Quote
  #40  
Old 28 Oct 2007, 06:55
andrewy3k's Avatar
andrewy3k andrewy3k is offline
 
Join Date: Oct 2006
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
Reply With Quote
  #41  
Old 28 Oct 2007, 07:19
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by andrewy3k View Post
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
This won't improve loading times. The entire page still has to load, and this mod does not affect that. What it does do is keep the page from appearing to hang when it is "almost" done loading. It appears to hang (in some, not all cases), because the pixel image at the bottom of the page, that calls the cron script doesn't load until the cron script is done running. This mod requests the cron image via JS after the page has been loaded, eliminating the annoying pages that are apparently loaded (visually they are all there), but the loading indicator in the browser says the page is still loading because the cron image is still loading.
__________________
My vBulletin Modifications.
Reply With Quote
  #42  
Old 28 Oct 2007, 07:27
andrewy3k's Avatar
andrewy3k andrewy3k is offline
 
Join Date: Oct 2006
hmm, I'm trying to recall if thats ever been noticeable on my board.. if there is hang time maybe half a second to a second max to a point it may not be noticeable.. not sure what I should be looking for .. the only hangtime I notice is loading after $navbar .. but thats just because I have a larger board..
Reply With Quote
  #43  
Old 28 Oct 2007, 07:55
The Bish's Avatar
The Bish The Bish is offline
 
Join Date: Sep 2006
Good lord man! This has solved an issue I have been having with my board for some time. Where in the hell do I send your Christmas Card too?
Reply With Quote
  #44  
Old 28 Oct 2007, 08:45
andrewy3k's Avatar
andrewy3k andrewy3k is offline
 
Join Date: Oct 2006
Originally Posted by The Bish View Post
Good lord man! This has solved an issue I have been having with my board for some time. Where in the hell do I send your Christmas Card too?
whats that?.. please do share..
Reply With Quote
  #45  
Old 28 Oct 2007, 09:04
The Bish's Avatar
The Bish The Bish is offline
 
Join Date: Sep 2006
I have been having the page load and then hang for what seemed like 5 seconds. Had members complain that it took upwards of 5 seconds or more at times to load. I have been IMing a few of them and they all say it is loading faster although one person says I have a ton of shit html which could also be an issue. So as far as the load hang goes... the usual complainees seem to think it is working better since the install.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:25.

Layout Options | Width: Wide Color: