Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Load templates from XCache Details »
Load templates from XCache
Mod Version: 1.0.0 Beta, by Andreas (Coder) Andreas is offline
Developer Last Online: Mar 2019 I like it Show Printable Version Email this Page

vB Version: 4.1.0 Rating: (3 votes - 5.00 average) Installs: 35
Released: 27 Dec 2010 Last Update: 06 Jan 2011 Downloads: 302
Not Supported DB Changes Additional Files Is in Beta Stage  

By default vBulletin loads templates out of the database which means that all templates that are required on a page must be loaded ("cached") before the first template gets rendered.

If a template is not cached an additional dataase query is required.

This Add-on loads templates from XCache on demand, completely emiminating the need for database reads after an initial pageload.

By loading templates on demand only those templates that are really being used on a page will be loaded into memory, so theoretically this Add-on should
  • Decrease memory footprint
  • Decrease page creation time (as loading data from a shared memory storage like XCache is faster than DB access)
  • Remove 1+X (X = amount of uncached templates) queries per page

How is that different to other existing tools like vBOptimise?
Most existing tools (at least the ones I know of) load all templates upfront, just like vBulletin would do if the DB is used.
This means that only those templates that are explicitly cached will be loaded from the cache, uncahed templates will cause additional database queries.

Can I use this Add-on my hared Webhosting?
Most likely not as it requires XCache with variable caching enabled which is usually not the case on shared hosts

I use multiple webservers, is that a problem?
It should work just fine with multiple webservers but that has not been tested so far.

Are there any other drawbacks?
Yes, this Add-on might be (be is not necessarily) incompatible with Add-ons that manipulate the template cache at runtime (which is a technique that is genreally deprecated).

History
1.0.0 Beta 1
First Public Release

1.0.0 Beta 2
  • Fixed incorrect variable initialisation that caused problems with other Add-ons that manipulate the template cache
    Important: Such techniques (like using str_replace(), etc.) are deprecated and it is strongly advised not to use Add-ons that do such auto-template changes.
  • Increased Plug-in execution order to the maximum to ensure all Templates cached via Plug-ins are grabbed

1.0.0 Beta 3
  • Fixed missing global in Hook template_compile
  • Added prefix setting to config.php

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.
Similar Mod
Mod Developer Type Replies Last Post
Microstats - load times, server loads, queries, uncached templates ShiningArcanine vBulletin 3.5 Add-ons 406 27 Feb 2011 10:37
Microstats (only for admin) - load times, server loads, queries, uncached templates! Erwin vBulletin 3.0 Full Releases 270 02 Mar 2009 11:16

  #16  
Old 06 Jan 2011, 22:21
rob01 rob01 is offline
 
Join Date: Sep 2008
Real name: robert
cant use XCache

shared hosting :S
Reply With Quote
  #17  
Old 08 Jan 2011, 05:26
ImmortalForums ImmortalForums is offline
 
Join Date: Feb 2007
Is there a benefit it running this with vboptimise as vboptimise puts them into xcache or any other cache system you are using?

I did some tests with this on with vb vboptimise page load speeds are identical but this causes one more query. Without looking into the code I am going to assume you are doing the exact same thing as vboptimise.

Also they can not run together as then no templates get cached.
Reply With Quote
  #18  
Old 08 Jan 2011, 08:44
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Originally Posted by ImmortalForums View Post
Is there a benefit it running this with vboptimise as vboptimise puts them into xcache or any other cache system you are using?
If it is possible to tell vBOptimise not to cache templates - yes.
If it always does - no.

Without looking into the code I am going to assume you are doing the exact same thing as vboptimise.
No. vBOptimise does precache all templates that are set to be cached on hook cache_templates (+ a few more once that are normally not cached).
This Add-on caches Templates purely on demand, it does not precache any templates which gives you two advantages:
  • Only those templates that are actually being used are cached
  • There won't be any uncached templates at all (which AFAIK can still happen with vBOptimise)
Reply With Quote
  #19  
Old 08 Jan 2011, 20:59
Robru's Avatar
Robru Robru is offline
 
Join Date: Aug 2005
Thanks for sharing this, it's very useful
Reply With Quote
  #20  
Old 09 Jan 2011, 01:11
ImmortalForums ImmortalForums is offline
 
Join Date: Feb 2007
I have disabled optimize cache of templates and will see how this compares in a couple of days and see if stats show anything.
Reply With Quote
  #21  
Old 10 Jan 2011, 18:23
ImmortalForums ImmortalForums is offline
 
Join Date: Feb 2007
blog_postbit_blog_link
blog_postbit_entries_link
postbit_ip
threadadmin_imod_menu_post

Not getting cached and its causing certain users on my forums to not be able to see threads. If I log in as the user I can see the threads though.
Reply With Quote
  #22  
Old 12 Jan 2011, 21:11
oddmud's Avatar
oddmud oddmud is offline
 
Join Date: Oct 2009
Originally Posted by rob01 View Post
cant use XCache

shared hosting :S
my shared hosting has xcache.
__________________
Like Fly Fishing?
www.flyfishbc.com
Reply With Quote
  #23  
Old 13 Jan 2011, 11:37
hilfe-forum hilfe-forum is offline
 
Join Date: Oct 2005
Location: http://www.alpha-board.eu
Real name: http://www.alpha-board.eu
Hmm not work for me...


Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/includes/class_core.php(4429) : eval()'d code on line 1
__________________
Alpha-Board
Reply With Quote
  #24  
Old 07 May 2011, 00:00
gibigbig gibigbig is offline
 
Join Date: Jul 2007
not working on vb 4.1.3 with vboptimise enabled

white screens mayyyn
Reply With Quote
  #25  
Old 31 May 2011, 04:04
hilfe-forum hilfe-forum is offline
 
Join Date: Oct 2005
Location: http://www.alpha-board.eu
Real name: http://www.alpha-board.eu
Help please

[Tue May 31 05:00:04 2011] [error] [client 92.226.138.146] PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/includes/class_core.php(4448) : eval()'d code on line 1, referer: http://www.xxx.de/
__________________
Alpha-Board
Reply With Quote
  #26  
Old 31 May 2011, 04:21
fabiocesar fabiocesar is offline
 
Join Date: Nov 2007
Originally Posted by gibigbig View Post
not working on vb 4.1.3 with vboptimise enabled

white screens mayyyn

disable all option with vboptimise.. xD
Reply With Quote
  #27  
Old 14 Jun 2011, 19:59
Neo_obs Neo_obs is offline
 
Join Date: Mar 2006
Real name: Jeff Baldwin
I am getting a problem with sending new private messages in 4.1.4 anyone else?

Is vboptimise good? I had issues before.
Reply With Quote
  #28  
Old 02 Jul 2011, 02:51
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Real name: Joe
I +1 for 3.8
__________________
I'll buy your forum!
Reply With Quote
  #29  
Old 02 Jul 2011, 23:33
cherylferraro's Avatar
cherylferraro cherylferraro is offline
 
Join Date: Oct 2005
Working for me on 4.1.4.

Great mod, thank you for sharing it.
Reply With Quote
  #30  
Old 24 Jul 2011, 04:03
washingtonboise washingtonboise is offline
 
Join Date: Mar 2009
4.1.4. PL2, fully patched and up to date.

Attempted install. Got fatal error message followed by about 30 pages of verbose text.

Fatal error: Xcache not installed in [path]/includes/adminfunctions_plugin.php(931) : eval()'d code on line 3
#0 vb_error_handler(256, Xcache not installed, /home/rpgresel/public_html/includes/adminfunctions_plugin.php(931) : eval()'d code, 3, Array ([xml] => This Add-on uses XCache to cache templates 1.0.0 Beta 3 '); require_once(DIR . '/includes/class_dbalter.php'); $dbalter = new vB_Database_Alter_MySQL($db); echo('
Altering Table style ...'); vbflush(); $dbalter->fetch_table_info('style'); $dbalter->add_field(array ( 'name' => 'revision', 'type' => 'INT', 'length' => '11', 'null' => false, 'default' => NULL, )); echo('Done!
'); vbflush(); echo(''); vbflush();]]> '); require_once(DIR . '/includes/class_dbalter.php'); $dbalter = new vB_Database_Alter_MySQL($db); echo('
Altering Table style ...'); vbflush(); $dbalter->fetch_table_info('style'); $dbalter->drop_field('revision'); echo('Done!
'); vbflush(); echo(''); vbflush();]]> cache_templates templatecache = new TemplateCache_XCache($cache, $vbulletin, $GLOBALS['style']);]]> template_compile db->shutdown_query("UPDATE " . TABLE_PREFIX . "style SET revision = revision + 1", 'stylerevision');]]> ,[allow_overwrite] => 1,[vbphrase] => Array ([1_day_ago] => 1 Day Ago,[1_hour_ago] => 1 Hour Ago,[1_minute_ago] => 1 Minute Ago,[1_week_ago] => 1 Week Ago,[VSa_APBOUPC] => VSa - Advanced Permissions Based on Post Count,[a_closed_forum] => A Closed Forum,[accept] => Accept,[action] => Action,[active_members] => Active Members,[active_subscriptions] => Active Subscriptions,[add_as_contact] => Add as Contact,[add_as_friend] => Add as Friend,[add_new_folders] => Add New Folders,[add_subscription] => Add Subscription,[add_x_to_contacts] => Add %1$s to Your Contacts,[adjust] => Adjust,[admin] => Admin,[admin_control_panel] => Admin Control Panel,[admin_required_register] =>
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:42.

Layout Options | Width: Wide Color: