vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Board Optimization - Load templates from XCache (https://vborg.vbsupport.ru/showthread.php?t=255994)

Andreas 12-26-2010 10:00 PM

Load templates from XCache
 
1 Attachment(s)
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

BiZiMDiYaR 12-28-2010 01:59 AM

Hi,

Has anybody tested this out.. ? As it's beta, I will wait to use on my forum, before I mess it up..

Thanks.

w-elbalad.com 12-28-2010 04:32 AM

Great Mod
Thanx
Installed

FReeSTER 12-28-2010 02:16 PM

Quote:

Originally Posted by BiZiMDiYaR (Post 2139934)
Hi,

Has anybody tested this out.. ? As it's beta, I will wait to use on my forum, before I mess it up..

Thanks.

If it comes from Andreas no worry to ask. :)

luan7749 12-28-2010 02:55 PM

What requirements ?

COL NIL SATIS 12-28-2010 04:34 PM

tagged

Andreas 12-28-2010 05:17 PM

Quote:

Originally Posted by luan7749 (Post 2140156)
What requirements ?

vBulletin 4.0.0 or higher
PHP 5.0 or higher
XCache 1.2.1 or higher

RustedBucket 12-28-2010 07:21 PM

Buggers... Just tried this on my board, meets all your requirements and then some.. Forumhome loaded fine but nothing else did. Just got white screens. Not sure. I'll try and troubleshoot it later.

Andreas 12-29-2010 06:25 AM

@RustedBucket
To troubleshoot this it would be useful to get a list of all Add-ons you are using (feel free to send a PM if you do not want to post that publically).

demonfatal 12-29-2010 08:19 PM

This can be used with vBOptimise without conflict?

rajubd 12-29-2010 08:37 PM

Quote:

Originally Posted by demonfatal (Post 2140939)
This can be used with vBOptimise without conflict?

i don't know why vBOptimise incresing my server load. when i disable it server running well after apply it it goes high. this mod behave same like vboptimise?

Alfa1 12-31-2010 01:45 PM

Please consider to release a vb 3.8 version.

Andreas 12-31-2010 03:28 PM

No way, 3.8 is outdated :)

Shamil. 12-31-2010 03:42 PM

What's the benefit of this, over loading it from disk?

Alfa1 12-31-2010 03:58 PM

Quote:

Originally Posted by Andreas (Post 2141886)
No way, 3.8 is outdated :)

Haha, maybe true, but vb4 isnt ready yet. Im only using vb4 for smaller sites.

rob01 01-06-2011 08:21 PM

cant use XCache

shared hosting :S

ImmortalForums 01-08-2011 03:26 AM

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.

Andreas 01-08-2011 06:44 AM

Quote:

Originally Posted by ImmortalForums (Post 2145812)
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.

Quote:

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)

Robru 01-08-2011 06:59 PM

Thanks for sharing this, it's very useful :)

ImmortalForums 01-08-2011 11:11 PM

I have disabled optimize cache of templates and will see how this compares in a couple of days and see if stats show anything.

ImmortalForums 01-10-2011 04:23 PM

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.

oddmud 01-12-2011 07:11 PM

Quote:

Originally Posted by rob01 (Post 2145111)
cant use XCache

shared hosting :S

my shared hosting has xcache.

hilfe-forum 01-13-2011 09:37 AM

Hmm not work for me...


Quote:

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

gibigbig 05-06-2011 10:00 PM

not working on vb 4.1.3 with vboptimise enabled

white screens mayyyn

hilfe-forum 05-31-2011 02:04 AM

Help please

Quote:

[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/

fabiocesar 05-31-2011 02:21 AM

Quote:

Originally Posted by gibigbig (Post 2192796)
not working on vb 4.1.3 with vboptimise enabled

white screens mayyyn


disable all option with vboptimise.. xD

Neo_obs 06-14-2011 05:59 PM

I am getting a problem with sending new private messages in 4.1.4 anyone else?

Is vboptimise good? I had issues before.

TheComputerGuy 07-02-2011 12:51 AM

I +1 for 3.8

cherylferraro 07-02-2011 09:33 PM

Working for me on 4.1.4.

Great mod, thank you for sharing it.

washingtonboise 07-24-2011 02:03 AM

4.1.4. PL2, fully patched and up to date.

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

Quote:

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] =>

Neo_obs 07-24-2011 10:10 PM

You don't have Xcache installed or configured correctly.

SnakeV 07-26-2011 04:10 PM

Quote:

Originally Posted by TheComputerGuy (Post 2215692)
I +1 for 3.8

+1 for 3.8x :)

prandah 08-25-2011 06:04 AM

i get somwe error :)
my question how to install xcache on nginxcp proxy?

TeknoSounds 08-25-2011 08:10 AM

Quote:

Originally Posted by prandah (Post 2237773)
i get somwe error :)
my question how to install xcache on nginxcp proxy?

http://www.google.com/search?q=xcach...ient=firefox-a

prandah 09-14-2011 11:46 AM

hello,
i was install xache on myserver ( cpanel ) via easy apache
but plugin can't install correctly ?

TeknoSounds 09-15-2011 03:00 AM

Quote:

Originally Posted by prandah (Post 2245813)
hello,
i was install xache on myserver ( cpanel ) via easy apache
but plugin can't install correctly ?

more details?
what is the error you get?

prandah 09-15-2011 07:18 AM

Quote:

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/ditusuk/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_reply] => 1 reply,[1_week_ago] => 1 Week Ago,[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,[admin] => Admin,[admin_control_panel] => Admin Control Panel,[admin_required_register] => The administrator may have required you to register before you can view this page.,[administrative] => Administrative,[administrator_decided_x_quiet] => The administrator has decided that %1$s should be quiet for a while.,[administrator_may_disabled_account] => If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.,[ads_ct_forum_select] => Hold down the [Ctrl]-Key for multiple selections,[ads_ct_joindate] => Always,[ads_ct_location] => Advertising world,[ads_ct_npost] => Many,[ads_ct_usertitle] => Circuit advertisement,[advanced_search] => Advanced Search,[age] => Age,[albums] => Albums,[alert_board_off] => Alert: The forums are currently turned off!,[all] => All,[all_forums] => All Forums,[all_times_are_gmt_x_time_now_is_y] => All times are GMT +8. The time now is 04:20 PM.,[allow_bbcode] => Allow BB Code,[allow_html] => Allow HTML,[allow_img_code] => Allow [IMG] Code,[allow_smilies] => Allow Smilies,[announcement] => Announcement,[announcements] => Announcements,[announcements_in_forum] => Announcements in Forum,[any_prefix_meta] => Any Prefix,[april] => April,[archive] => Archive,[at] => at,[attached_files] => Attached Files,[attached_images] => Attached Images,[attached_thumbnails] => Attached Thumbnails,[attachment] => Attachment,[attachment_statistics] => Attachment Statistics,[attachments] => Attachments,[august] => August,[author] => Author,[back_to_x_profile] => Back to %1$s's Profile,[bb_code_is_x] => BB code is %2$s,[bbcode_allowed] => BB Code Allowed,[bbcode_not_allowed] => BB Code is not allowed,[become_a_friend] => Become a Friend,[befriend_x] => Befriend %1$s,[bop5_share_this_forum] => Share This Forum,[by_x] => by %2$s,[by_x_guest] => by %1$s,[by_x_memberaction] => by %1$s,[by_x_user_on_y_date] => %2$s on %3$s,[by_xlink_yguest] => by %2$s,[bytes] => Bytes,[calendar] => Calendar,[can_moderate_user_signatures] => Can Moderate User Signatures,[cancel] => Cancel,[cancel_changes] => Cancel Changes,[cant_identify_image] => Can't identify the image? Click it to get a new one.,[caps_lock_is_on] => Caps Lock is on!
but 'm sure i was installed xcached correctly

TeknoSounds 09-16-2011 01:31 AM

Well according to that error, its either not installed correctly or not pointing to the correct place.

According to a phpinfo page is xcache showing up?

Are you able to bring up the XCache Admin page and perform cache clears?

Did you set vbulletin to use xcache in its config?

prandah 09-19-2011 05:22 AM

Quote:

Originally Posted by TeknoSounds (Post 2246573)
Well according to that error, its either not installed correctly or not pointing to the correct place.

According to a phpinfo page is xcache showing up?

Are you able to bring up the XCache Admin page and perform cache clears?

Did you set vbulletin to use xcache in its config?

no, how and where i set it ?

TeknoSounds 09-19-2011 01:03 PM

first thing first, create a phpinfo page.

PHP Code:

<?php phpinfo(); ?>

Put it somewhere in the public side of your website (like the root of it) and bring it up. Then do a Find on Xcache. You should see something similar to:
Code:

XCache
XCache Support        enabled
Version        1.3.0
Modules Built        cacher
Readonly Protection        N/A
Cache Init Time        2011-09-19 06:15:06
Cache Instance Id        1723
Opcode Cache        enabled, 134,217,728 bytes, 4 split(s), with 8192 slots each
Variable Cache        enabled, 134,217,728 bytes, 4 split(s), with 8192 slots each
Shared Memory Schemes        mmap

If you don't, you don't have xcache installed properly.


All times are GMT. The time now is 05:03 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
  • Page Generation 0.02623 seconds
  • Memory Usage 1,840KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete