• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Caching Phrases

R

ragtek

Guest
#1
ATM I'm creating cached phrases for the navbar and all other are uncached.
When should we use cached phrases and when not?
 

Lawrence

Well-known member
#2
I cache phrases I think are going to be used frequently (front end). For those in the ACP, I don't cache as they won't be used that often.
 

Kier

XenForo Developer
Staff member
#3
You only need to cache phrases that are not referenced directly in templates.

So, this phrase:

my_template
<p>{xen:phrase my_phrase}</p>

... does not need to be cached, while the one referenced here:

another_template
<p>{xen:phrase $phraseName}</p>

... needs to be cached or it won't work.

It's not really a matter of caching for performance, it's a matter of caching so that the phrase is available at all. If the phrase content can be known at the point at which you save the template, it likely does not need to be cached.