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.
  #46  
Old 28 Oct 2007, 08:29
PoetJA-1975's Avatar
PoetJA-1975 PoetJA-1975 is offline
 
Join Date: Sep 2006
Real name: Jacquii Cooke
Originally Posted by Saviour View Post
Noticeable improvement on page loading time. Much appreciated! Marked Installed...
I agree! Thanx so much to the Author of this fine modification

Jacquii.
Reply With Quote
  #47  
Old 28 Oct 2007, 09:48
andrewy3k's Avatar
andrewy3k andrewy3k is offline
 
Join Date: Oct 2006
Maybe I should try .. see if it makes any difference.. I don't think it will.. but wont hurt
Reply With Quote
  #48  
Old 28 Oct 2007, 19:04
andrewy3k's Avatar
andrewy3k andrewy3k is offline
 
Join Date: Oct 2006
I tried it.. didn't see any noticeable differences.. in both FF and IE
Reply With Quote
  #49  
Old 29 Oct 2007, 01:20
timothydog76 timothydog76 is offline
 
Join Date: Oct 2007
Installed this today. Seems cool. I noticed one minor glitch (nitpicking really). If I look in the plugins manager the drop-down box and "Go" button are oriented funny. Is this an issue anyone else is seeing?

Thanks,
Attached Images
File Type: jpg huh.jpg (23.7 KB, 57 views)
Reply With Quote
  #50  
Old 29 Oct 2007, 04:04
jawatkin jawatkin is offline
 
Join Date: Apr 2007
This is a godsend, seriously. I always hated that delay, it was annoying as ever.... And now... Thank you!!
Reply With Quote
  #51  
Old 30 Oct 2007, 17:53
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by timothydog76 View Post
Installed this today. Seems cool. I noticed one minor glitch (nitpicking really). If I look in the plugins manager the drop-down box and "Go" button are oriented funny. Is this an issue anyone else is seeing?

Thanks,
That is a problem with vBulletin (with any products you install), and is not directly related to this product. But I hear you, I think it's annoying too.
__________________
My vBulletin Modifications.
Reply With Quote
  #52  
Old 01 Nov 2007, 07:04
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Originally Posted by Analogpoint View Post

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?
That's a nice bulldozer post to get people to use your product instead of the original. lol Nothing like being insulted by someone you don't know.

Just to answer your mud flinging.

The hacked cron file returns less crap that is not needed and prevents many issues that were found using cron.php.

The uploaded javascript is cached by the users browser where your inline js must be downloaded with each and every page load.

It works fine with vbadvanced.

And as far as users without js, it defaults to the normal vb method.

Oh, and it only loads when a cron is to be run. Not every page load like this one.

And what's best of all, it's original.

Nice people don't fling mud. Have a nice day.
__________________
Gaming Forums
Reply With Quote
  #53  
Old 01 Nov 2007, 07:59
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Originally Posted by Code Monkey View Post
That's a nice bulldozer post to get people to use your product instead of the original. lol Nothing like being insulted by someone you don't know.

Just to answer your mud flinging.

The hacked cron file returns less crap that is not needed and prevents many issues that were found using cron.php.

The uploaded javascript is cached by the users browser where your inline js must be downloaded with each and every page load.

It works fine with vbadvanced.

And as far as users without js, it defaults to the normal vb method.

Oh, and it only loads when a cron is to be run. Not every page load like this one.

And what's best of all, it's original.

Nice people don't fling mud. Have a nice day.

Code Monkey,

I offer you my sincerest apologies. I created this mod for my own personal use, and I created it to the best of my abilities. My post that you call 'mud flinging' was an attempt to compare the two mods, only since someone asked. I never told anyone to use my mod instead of yours, everyone's free to use what they want. My personal preference with modifications, is the simpler and more straightforward it is, the better. You have misinformation in your post, concerning both the mods, which I won't respond to. Each user can decide for themselves which mod they want to install, if any. I hope you'll forgive me and not feel that I'm stepping on your toes. I hope we can peacefully coexist here on vB.org.

Respectfully,
David.
__________________
My vBulletin Modifications.
Reply With Quote
  #54  
Old 01 Nov 2007, 09:02
mhackl mhackl is offline
 
Join Date: Sep 2006
I installed this and noticed a significant increase in performance. Better in Firefox than IE though.
__________________
vBulletin® Version 4.0.1 | PHP version 5.2.2 | Mysql version 5.0.24a | Netfirms "Enterprise One" Hosting
Reply With Quote
  #55  
Old 02 Nov 2007, 02:30
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Thanks for this! very smart MOD .twothumbsup.
Reply With Quote
  #56  
Old 06 Nov 2007, 14:33
Paxion Paxion is offline
 
Join Date: Aug 2007
Greatest mod I have so far.... and my forum has pretty much everything.
Reply With Quote
  #57  
Old 08 Nov 2007, 10:59
kollam003 kollam003 is offline
 
Join Date: May 2007
Indianprofits.com clicks install
__________________
Gratitude for everything I have
Reply With Quote
  #58  
Old 09 Nov 2007, 11:39
class101 class101 is offline
 
Join Date: Sep 2007
Real name: A.D
thank you , this addon fixed a problem I had with $cronimage and Zoints Tags rewritten urls

Last edited by class101; 09 Nov 2007 at 11:55.
Reply With Quote
  #59  
Old 15 Nov 2007, 15:27
69lakalle's Avatar
69lakalle 69lakalle is offline
 
Join Date: Apr 2007
Can you add an option were we can set the sizes for posts and signatures separate ?
Reply With Quote
  #60  
Old 06 Dec 2007, 11:50
plothook plothook is offline
 
Join Date: Apr 2007
* Clicks Mark as Uninstalled *
Those annoying hangs in Firefox are a thing of the past!

Thanks Analogpoint!
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 03:13.

Layout Options | Width: Wide Color: