|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
adn Smarty Regular
Joined: 31 May 2011 Posts: 91
|
Posted: Sat Mar 24, 2012 5:54 pm Post subject: cache tag with duration |
|
|
Hello,
I would suggest to have the ability to define a duration time in seconds on the cache tag, something like
{nocache duration=3600}
.....
{/nocache}
In my main template I have several nocache section and I like first to be able to define the time duration and also a different duration: one section with 15 minutes, an other every 24h etc...
Thanks |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Mar 24, 2012 6:21 pm Post subject: |
|
|
This does not make sense because you would still need to assign the variables used in the {nocache} at each page call. So you gain no performance.
You can specify individual cache life times with {include} for subtemplates. But this does add the overhead of a second cache file.
So in most cases different life times do not make sense performance wise. |
|
Back to top |
|
adn Smarty Regular
Joined: 31 May 2011 Posts: 91
|
Posted: Sun Mar 25, 2012 10:15 am Post subject: |
|
|
Thanks for your explaination.
I didn't know that cache_lifetime was usable on include.
Using this attribute on include need to have Smarty::CACHING_LIFETIME_SAVED activated I suppose |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Mar 25, 2012 10:53 am Post subject: |
|
|
Smarty::CACHING_LIFETIME_SAVED is not necessary. |
|
Back to top |
|
adn Smarty Regular
Joined: 31 May 2011 Posts: 91
|
Posted: Sun Mar 25, 2012 12:09 pm Post subject: |
|
|
One more question, is that compatible with INLINE attribute?
Thanks !! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Mar 25, 2012 12:30 pm Post subject: |
|
|
No, if you use individual caching it does disable the global $merge_compiled_includes setting and the inline attribute for the included subtemplate. |
|
Back to top |
|
|
|
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
|