vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   when do i need to cache templates? (https://vborg.vbsupport.ru/showthread.php?t=322069)

Dr.CustUmz 03-09-2016 11:05 PM

when do i need to cache templates?
 
im editing my new release
https://vborg.vbsupport.ru/showthread.php?t=322031

and in it i cache a temple, then in the next plugin i eval that template so i can shortcode it into another template, like so:
Code:

<plugin active="1">
      <title>cache templates</title>
      <hookname>cache_templates</hookname>
      <phpcode><![CDATA[

        $globaltemplates = array_merge($globaltemplates, array('drc_lf_css'));

]]></phpcode>
    </plugin>
    <plugin active="1" executionorder="5">
      <title>global templates</title>
      <hookname>global_start</hookname>
      <phpcode><![CDATA[

eval('$drcextcss  = "' . fetch_template('drc_lf_css') . '";');

    ]]></phpcode>
    </plugin>

in the mist of adding a new template to global cache i accidentally removed the original cache, which had no effect on my product.

so im just wondering. when is there the need to cache a template? I always thought they needed to be cached

squidsk 03-10-2016 02:39 AM

If you don't cache the templates, each non cached template is another db query

Dr.CustUmz 03-10-2016 04:37 AM

Quote:

Originally Posted by squidsk (Post 2566911)
If you don't cache the templates, each non cached template is another db query

so like i thought, always cache the template

squidsk 03-10-2016 02:12 PM

Yes, always. If you have your dev site in debug mode you'll see any templates that aren't cached labelled in red.


All times are GMT. The time now is 04:30 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.01123 seconds
  • Memory Usage 1,714KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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