You are here: Re: [SMARTY] Caching: {include} and specific cache lifetime « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Caching: {include} and specific cache lifetime

Posted by boots on 10/06/48 11:22

Hi Erik.

You may be interested in this post and the thread it belongs to:

http://www.phpinsider.com/smarty-forum/viewtopic.php?p=19733#19733

One of the plugins provided in that post provides for including with
template specified caching parameters.

A long time ago there was another thread that considered assigning
template specific caching attributes. I think it is a worthy idea
compared to template controlled caching but it is likely more trouble
than it is worth, IMHO.

--- Erik Schmitt <e.schmitt@e-novum.com> wrote:
> Hello,
>
> is it possible to assign a specific cache lifetime to
> an {include} statement?
>
> In my application I use some master-templates;
> each master-templates includes necessary sub-templates.
> I accumulate all variables before invoking smarty.
>
> Example:
>
> template.a.tpl
> -> inlcudes: module.header.tpl
> -> inlcudes: module.content.tpl
> -> inlcudes: module.footer.tpl
>
> Is it possible to use different cache lifetimes here for
> each sub-template using {include}, or do I need to have
> a php-master-template in which I work with the smarty
> object (as described in the documentation)? The later
> option seems a bit messy to me, because of the usage
> of php in a template context.
>
> What do you think about a lifetime-attribute like:
> {include file="bla.tpl" lifetime=3600} ?
>
>
> Another idea: what about a config file (or an array)
> which holds lifetime-values for templates and can be assigned
> to the smarty-object? This would
> help in situations like this one, where "content1" should
> live 3600 seconds, but "content2" only 100 seconds:
>
> template.a.tpl
> -> inlcudes: module.header.tpl
> -> inlcudes: module.content1.tpl OR inlcudes:
> module.content2.tpl
> -> inlcudes: module.footer.tpl
>
> $smarty->assign_lifetimes(
> array(
> "module.content1.tpl" => 3600, module.content2.tpl => 100));
>
>
> What do you think?
>
> Thanks!
> Erik



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация