View Full Version : How to Cache an Uncached Template
dsboyce8624
16 May 2005, 01:04
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
zetetic
25 May 2005, 01:50
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.
Zachery
25 May 2005, 04:00
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.
zetetic
25 May 2005, 18:04
Not all templates should be cached globally however.
Isn't that what I just explained, or do you mean something else?
Zero Tolerance
25 May 2005, 19:10
I think Zac only read the opening line to your post :p
- Zero Tolerance
deathemperor
25 May 2005, 19:34
I believe there're at least 2 threads for this...
zetetic
25 May 2005, 20:56
I think Zac only read the opening line to your post :p
I hope so! I thought I was going crazy. :D
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. :)
dsboyce8624
30 May 2005, 07:33
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.
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:
zetetic
30 May 2005, 08:05
I stumbled on this post (http://www.vbulletin.com/forum/showpost.php?p=472666&postcount=7) 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. :)
Gizmo5h1t3
14 Aug 2005, 22:35
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...
thanks for that great hack
but the templates are not cached,
how to cache the template
Powered by vBulletin® Version 3.8.3, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Page generated in 0.52030 seconds with 28 queries (2 queries for uncached templates)
Uncached templates: nlp_notifications_usercp (1)
Uncached templates: nlp_notifications_usercp_bit (1)
I am pretty sure there is a more recent version of this article that shows how to cache the templates using plugins.
HMBeaty
18 Jul 2009, 22:11
thanks for that great hack
but the templates are not cached,
how to cache the template
Powered by vBulletin® Version 3.8.3, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Page generated in 0.52030 seconds with 28 queries (2 queries for uncached templates)
Uncached templates: nlp_notifications_usercp (1)
Uncached templates: nlp_notifications_usercp_bit (1)
You could create a plugin with the hook location cache_templates and in the box for the Plugin PHP Code you would insert this code
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Hope that helps :)
You could create a plugin with the hook location cache_templates and in the box for the Plugin PHP Code you would insert this code
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Hope that helps :)
thanks alot bro its really working as well
I am pretty sure there is a more recent version of this article that shows how to cache the templates using plugins.
i'm looking for it (for vB 4) ... i've searched but i can't find anything ...
i'm looking for it (for vB 4) ... i've searched but i can't find anything ...
for vB4:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
OR
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You could create a plugin with the hook location cache_templates and in the box for the Plugin PHP Code you would insert this
for vB4:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
OR
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
so i need to create a new plugin and then put the code that you give me Lynne? correct?
Yes, you need to create a plugin to cache the templates.
perfect! runs correctly! :) as always thanks Lynne for the tips ;)
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.