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.
Comments
  #2  
Old 18 Oct 2007, 18:05
DragonMasterNYC's Avatar
DragonMasterNYC DragonMasterNYC is offline
 
Join Date: Jul 2007
Location: Bronx NY
Real name: Manny
I like it installing now
__________________
Unknown Assassins: Up and running
Reply With Quote
  #3  
Old 18 Oct 2007, 19:14
dazed12 dazed12 is offline
 
Join Date: Jul 2006
i've installed and trying it out. looks nice
thanks
Reply With Quote
  #4  
Old 18 Oct 2007, 20:42
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
so this speends up our forum or what
Reply With Quote
  #5  
Old 18 Oct 2007, 20:48
Mrdby Mrdby is offline
 
Join Date: Apr 2007
Real name: MrDby
interesting
Reply With Quote
  #6  
Old 18 Oct 2007, 20:48
DragonMasterNYC's Avatar
DragonMasterNYC DragonMasterNYC is offline
 
Join Date: Jul 2007
Location: Bronx NY
Real name: Manny
Originally Posted by aveon View Post
so this speends up our forum or what
Yes it does just a little your forums won't stall when a task is being done.
__________________
Unknown Assassins: Up and running
Reply With Quote
  #7  
Old 18 Oct 2007, 20:49
ciprianrpp ciprianrpp is offline
 
Join Date: Oct 2007
works pretty..thank you . installed
Reply With Quote
  #8  
Old 18 Oct 2007, 20:51
Mrdby Mrdby is offline
 
Join Date: Apr 2007
Real name: MrDby
installed
Reply With Quote
  #9  
Old 18 Oct 2007, 20:56
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
yea installed and works fine thanx
Reply With Quote
  #10  
Old 18 Oct 2007, 21:17
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Excellent addition .. thanks Analogpoint

Clicked install
Reply With Quote
  #11  
Old 18 Oct 2007, 22:13
Milad's Avatar
Milad Milad is offline
 
Join Date: May 2005
Real name: Milad
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.
Reply With Quote
  #12  
Old 18 Oct 2007, 22:45
Mrdby Mrdby is offline
 
Join Date: Apr 2007
Real name: MrDby
When i refresh using Mozilla..it gives me a grey screen and then goes back to normal.Why is that?
Reply With Quote
  #13  
Old 19 Oct 2007, 01:40
PoetJA-1975's Avatar
PoetJA-1975 PoetJA-1975 is offline
 
Join Date: Sep 2006
Real name: Jacquii Cooke
Interesting share = Thanx

Jacquii.
Reply With Quote
  #14  
Old 19 Oct 2007, 04:29
Lizard King's Avatar
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Real name: Mert
http://www.vbulletin.org/forum/showthread.php?t=123719
__________________
Mert Gökçeimam / Crawlability Inc.

DepKaç | vBSEO 3.3.0 - vBulletin Search Engine Optimisation
Reply With Quote
  #15  
Old 19 Oct 2007, 05:23
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by Milad View Post
Very good.

But, will be there a conflict with the <body onload="bla bla bla">?
No.

Originally Posted by Milad View Post
Is it compatible with all browsers? especially IE6-7 FF1.5 FF2.
Yes.

Originally Posted by Mrdby View Post
When i refresh using Mozilla..it gives me a grey screen and then goes back to normal.Why is that?
This doesn't affect the display of your forums layout in any way.

That's a classic case of using a bulldozer to knock over a molehill. You have to upload a Javascript file, and a php file, as well as install the product. It uses AJAX where AJAX is not needed. It makes you run a hacked version of vB's cron.php file. It doesn't work with vBadvanced, vBdruapal and others. I'm not sure how it deals with users who don't have Javascript enabled. This mod has none of those problems. Shall I continue?
__________________
My vBulletin Modifications.
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 01:41.

Layout Options | Width: Wide Color: