Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Is it possible to disable cache for included templates?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
orao
Smarty Rookie


Joined: 23 Dec 2009
Posts: 20

PostPosted: Thu Dec 23, 2021 9:56 am    Post subject: Is it possible to disable cache for included templates? Reply with quote

Hello,
i have a situation where templates are included with cache_id parameter.
Code:
{include file="subtemplate.tpl" cache_id="uid123"}


When I set globally $smarty->caching = 0 these included subtemplates still get cached.

Is it somehow possible to disable caching included subtemplates even if they have cache_id defined?

I am trying to avoid
Code:
{if $caching == true}
   {include file="subtemplate.tpl" cache_id="uid123"}
{else}
   {include file="subtemplate.tpl"}
{/if}
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Dec 31, 2021 5:28 am    Post subject: Reply with quote

Since explicitly passing cache_id explicitly enables caching

You get the idea, right? Perhaps, you did mean compile_id when writing these templates?
Back to top
View user's profile Send private message
orao
Smarty Rookie


Joined: 23 Dec 2009
Posts: 20

PostPosted: Fri Dec 31, 2021 3:03 pm    Post subject: Reply with quote

No I didn't mean compile_id. Now I understand that passing cache_id explicitly enables caching and there is no way to go around it.

thank you
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP