vBulletin Mods

The Official vBulletin Modifications Site

[tip] [phpinclude] Custom templates prased = extra query's
by Brad
01 Aug 2003 04:52

One of the most common things people forget when using phpinclude, is all templates called via the template are not chaced. (in vB 3 it's broken into two templates, phpinclude_start, and phpinclude_end. This text apply's to vB 3, as of beta 4)

vBulletin is not smart enough to cache templates on demand, instead a list of templates is generated when a page is called. This list is passed into a query that pull's every template needed at the same time. However templates that are not included in this list will force vBulletin to run a extra query to grab the template when it is called.

There is not way of chacing templates via the phpinclude template. Templates are cached before phpinclude is rendered/executed.

There are two things you can do to avoid these extra quries from poping up. The frist is going over to vBulletin.org and finding out how to chace templates via the files. This is easy to do but can not be disscussed here per board rules.

The second is not using templates at all, but hard-coding the html that is needed into phpinclude. Remember the rules of php apply here, and replacements can be used.

Last but not least, do not ever call a template inside a loop in phpinclude, unless you chache it via the files.

All times are GMT. The time now is 20:21.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.