vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Template Caching Question (https://vborg.vbsupport.ru/showthread.php?t=206983)

vbplusme 03-01-2009 08:30 AM

Template Caching Question
 
Hello,

I have three templates that I created, two of them are javascripts and one is a simple text display. None of them do database queries but they all get reported as being uncached by the Microstats hack that I just installed.

The question is this, is template caching related only to queries? Would caching the javascript be something that I need to take a look at and how would it work. I know that some of the php scripts I have installed have explicit caching script but they bare no resemblance to the original template that is being called?

Any insight would really be appreciated.

TIA

Dismounted 03-02-2009 05:11 AM

Templates are fetched en-masse at the start of execution. This is referred to as the "template cache". You need to add your templates to the $globaltemplates array to get your templates as well. Templates that are not cached will be fetched on request, using a query for every template.

vbplusme 03-02-2009 09:29 AM

Thank you, I guess I thought that they were loaded automagically, LOL

Where to find the $globaltemplates array to add them?

Dismounted 03-02-2009 09:40 AM

They are loaded automagically - it just costs queries. :p

Where are you using these templates?

vbplusme 03-02-2009 10:32 AM

One of the javascripts is seen only by visitors, the world clock (also a javascript) is under the navbar on every page and the text template is in the side bar on every page.

Dismounted 03-03-2009 04:52 AM

Can't you just add them to the templates themselves?


All times are GMT. The time now is 09:15 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.01022 seconds
  • Memory Usage 1,709KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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