Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How to Cache an Uncached Template
dsboyce8624
Join Date: May 2005
Posts: 413

 

New Jersey
Show Printable Version Email this Page Subscription
dsboyce8624 dsboyce8624 is offline 05-15-2005, 10:00 PM

I am posting this because it took me so long to find the answer. It may be elementary to those of you who have been doing this for a while, but not to me.

Anyway, here goes:

Open /forum_root/global.php

Find:

PHP Code:
//misc useful 
At the end of the column of template names add yours, don't forget the comma after the last one that's already there, like so:

PHP Code:
'already_there_template',
'template_you_need_cached' 
Reply With Quote
  #2  
Old 05-24-2005, 11:50 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good tip, Dennis.

However I'm pretty sure you should only do that for templates that are used on every page of your site. You can conserve memory by adding page specific and action specific templates to the $globaltemplates and $actiontemplates arrays (respectively) at the beginning of the file that uses them instead of adding them to global.php. Profile.php and usercp.php are good files to look at to see examples of this.
Reply With Quote
  #3  
Old 05-25-2005, 02:00 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tmhall
Good tip, Dennis.

However I'm pretty sure you should only do that for templates that are used on every page of your site. You can conserve memory by adding page specific and action specific templates to the $globaltemplates and $actiontemplates arrays (respectively) at the beginning of the file that uses them instead of adding them to global.php. Profile.php and usercp.php are good files to look at to see examples of this.
Not all templates should be cached globally however.
Reply With Quote
  #4  
Old 05-25-2005, 04:04 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery
Not all templates should be cached globally however.
Isn't that what I just explained, or do you mean something else?
Reply With Quote
  #5  
Old 05-25-2005, 05:10 PM
Zero Tolerance's Avatar
Zero Tolerance Zero Tolerance is offline
 
Join Date: Feb 2004
Location: England
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think Zac only read the opening line to your post

- Zero Tolerance
Reply With Quote
  #6  
Old 05-25-2005, 05:34 PM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe there're at least 2 threads for this...
Reply With Quote
  #7  
Old 05-25-2005, 06:56 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zero Tolerance
I think Zac only read the opening line to your post
I hope so! I thought I was going crazy.

Quote:
Originally Posted by deathemperor
I believe there're at least 2 threads for this...
I don't think we're in danger of having too many useful threads here.
Reply With Quote
  #8  
Old 05-30-2005, 05:33 AM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by deathemperor
I believe there're at least 2 threads for this...
Well, I couldn't find them. I found this info in the instructions for a hack.

Quote:
Originally Posted by tmhall
Good tip, Dennis.

However I'm pretty sure you should only do that for templates that are used on every page of your site. You can conserve memory by adding page specific and action specific templates to the $globaltemplates and $actiontemplates arrays (respectively) at the beginning of the file that uses them instead of adding them to global.php. Profile.php and usercp.php are good files to look at to see examples of this.
I will have to check this out. As I said above, I'm new to this. Everybody I asked about it said "Go ask whoever wrote the hack" and the hack was very old and unsupported. So I figured it out. But with your statement in here, I guess all the info is now available in one place! :banana:
Reply With Quote
  #9  
Old 05-30-2005, 06:05 AM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I stumbled on this post at vb.com earlier tonight. It's a couple years old but as far as I know it's still relevant. It gives a little more detail about the purpose of the different template arrays.
Reply With Quote
  #10  
Old 08-14-2005, 08:35 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by deathemperor
I believe there're at least 2 threads for this...
then post the links for em, coz i cant find em mate.

try to help out a bit more, instead of bunging up witty repartee.
if it was funny i wouldnt mind...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04830 seconds
  • Memory Usage 2,293KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete