vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Plugin Based Template Cache (https://vborg.vbsupport.ru/showthread.php?t=121876)

orban 07-07-2007 12:31 AM

My PayPal link is under Mod Information on top of this page :p Glad to have helped out! (And make sure eAcc got enough memory so it doesn't start removing files. And you if really want to push it and got the PHP knowledge try the experimental version I'm running it for several months and it works really smooooth. Though I guess the performance gain is about the same. )

Fenriz 07-20-2007 11:15 PM

Will it help with my configuration - vb 3.6.7pl1, mysql 4.1.21 (mysqli in config), php 5.2, without any php cache and acceleration (as my shared hosting site5 doesn't allow that).
Any suggestions?

orban 07-20-2007 11:27 PM

This modification is for HIGH TRAFFIC vB installations.

Fenriz 07-20-2007 11:45 PM

orban, anyway it will not reduse the speed of my configuration, only help, right?

orban 07-20-2007 11:48 PM

Not it can make your installation slower, use more resources, RAM, cpu.

Andreas 07-21-2007 01:56 PM

2 suggestions:
- Instead of another eval() call, just use an include() and make the include return the code
- Hook into template_compile to determine if a cache clear is necessary
This would also fire for style import, etc.

orban 07-21-2007 02:07 PM

1. How?

vB template calls are like this:

eval('$foo .= "' . fetch_template('bar') . '";');

fetch_template( ) returns the template as a string.

2. Is that hook new?

Andreas 07-21-2007 02:13 PM

1) Construct the file like
PHP Code:

<?php
return "template eval code";
?>

and

PHP Code:

$vbulletin->templatecache["$temp[title]"] = '".(include(\''$path $temp['templateid'] . '.php\'))."'

2) It's been there since the early 3.5 days

orban 07-21-2007 02:23 PM

1) Alright that works too thought I doubt there's any performance gain. I only use the experimental version anyway which basically does what you suggest just with functions.

2) Hmm, is that function called for every template? Might be a bad idea to clear the template cache 100 times when importing a style...not to mention importing a style doesn't require you to clear the template cache in the first place...? But for clearing the cache when editing a template might be worth a shot.

Andreas 07-21-2007 03:02 PM

1) Probably not a noticable one, but there is one.

2) compile_template() is called whenever a template is saved.
If didn't mean that you shuld clear the cache in this hook, just that a flag that the cache is dirty.
This flag could then be checked in admin_complete and the cache cleared if set.


All times are GMT. The time now is 11:34 AM.

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.01653 seconds
  • Memory Usage 1,732KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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