vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I... (https://vborg.vbsupport.ru/showthread.php?t=52231)

gwhooooey 04-27-2003 05:49 PM

How do I...
 
Do this?

Quote:

Quick tip to drastically reduce queries:

Move all your template names into the

$templatesused = " "

section at the top of index.php.

In your index.php, search for the keyword "template" - any template being eval() that is not in the $templatesused section is an extra query on the database. Just copy the name and add it to the list in $templatesused and watch those queries drop.
Can someone explain that in more detail please.

And is there any other things like this I could do to reduce queries..

Btw, if this is in the wrong forum, I apologise, and if you move it, please let me know. Thanks

filburt1 04-27-2003 05:52 PM

Defining $templatesused before requiring global.php will cache those templates. For example:
PHP Code:

$templatesused "mytemplate,anothertemplate";
require(
"./global.php"); 

...will cache those two templates. If you don't do that and then later in the file try to eval either template, it will create an extra query.

IMO I think it's a pretty dumb system; a better way (again, IMO) would be to associate each template with one or more PHP files, and then have the template engine automatically cache all necessary templates for that file.

Logician 04-28-2003 10:24 AM

Quote:

Yesterday at 09:52 PM filburt1 said this in Post #2
IMO I think it's a pretty dumb system; a better way (again, IMO) would be to associate each template with one or more PHP files, and then have the template engine automatically cache all necessary templates for that file.
In default vb caching system dev has freedom to decide whether he will cache a template or not.

It is not always desired to cache all templates a .php file uses because some of them are used only in certain conditions (like error templates or ignore user templates) and devs may not want to cache these everytime that php file runs. This is because everytime you cache a template you are eating up your server RAM. Sometimes you prefer to save some RAM space, instead of saving an extra query which will be very infrequently added.

gwhooooey 04-29-2003 03:15 AM

Thanks, I understand now

Xenon 04-29-2003 04:06 PM

as i should mention, vb3 will use a completly different system for templatecaching, much better in my eyes if it's like i think now ;)


All times are GMT. The time now is 10:04 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.01265 seconds
  • Memory Usage 1,721KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete