vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to cache the uncached templates (https://vborg.vbsupport.ru/showthread.php?t=245261)

KURTZ 06-25-2010 10:10 AM

How to cache the uncached templates
 
1 Attachment(s)
Hi folks, i need help (or tips) about the uncached templates, in the last days i've installed some products that have in some particular pages an uncached template, and i wanna cache them without waiting the author ...

for example: here's the 'adavanced forum rules' made by [name]valter[/name], i found an uncached template when i check an user profile.

so what i need is to know how i can cache this template ... remember i'm totally newbie about this things ... :) thanks in advantage for your tips ...

Lynne 06-25-2010 01:56 PM

You asked this in another thread also, so I posted it there, but here it is again.

for vB4:
PHP Code:

     $cache[] = 'your_template'


OR
PHP Code:

$cache  array_merge($cache, array(
     
'your_template1',
     
'your_template2',
     
'your_template3',
     
'your_template4',
     
'your_template5'
  
)); 


Nirjonadda 04-08-2012 08:06 PM

where I can add this code to make my uncached templates working?

kh99 04-08-2012 08:11 PM

You should be able to create a plugin using hook cache_templates. You might want to put an 'if' around it so it doesn't get cached when it's not used, like:

Code:

if (THIS_SCRIPT == 'something')
{
    $cache[] = 'your_template'; 
}


but I suppose it's better to cache it on every page than to not have it cached when it's used, so if you're not sure about it, just leave out the if.


All times are GMT. The time now is 12:29 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.01318 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_php_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