Re: [SMARTY] Caching newbie questions

From: Date: Fri, 04 Apr 2003 11:40:42 +0000
Subject: Re: [SMARTY] Caching newbie questions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9085@lists.php.net to get a copy of this message
As far as i used caching, the whole page will be cached (ie all the included files as well). Hence, there exists a nice feature called CacheID which allow grouping caches and clearing them by group name. Read more in the manual on the usage of the above, personally I find it amazing ;) since my cache expire time is set to 1 year, pages are recompiled only when something canges =) pt2002 wrote:
Hello I've start using Smarty cache features and I've followed the examples from the manual index.php $templ = new Smarty(); if (!is_cached("index.tpl") {
    db code; db code;
    assign code; assign code;
} $templ->display("index.tpl"); ========================================== index.tpl {include file="header.tpl"} {include file="left_nav_bar.tpl"}
    body content
{include file="footer.tpl} So far so good. Been reading some posts, I've see something like using several template but don't cache them all. Supose I don't want to cache left_nav_bar.tpl. I know the {insert} feature but it's not what I really want. Do I need to create a Smarty object for each template and se cache = false for left_nav_bar.tpl ? Something like this ?
    $header = new Smarty(); // cache = true
    $left_nav_bar = new Smarty(); // cache = false
    $index = new Smarty(); // cache = true
    $footer = new Smarty();  // cache = true
    assign code here
    $header->display("header.tpl");
    $left_nav_bar->display("left_nav_bar.tpl");
    $index->display("index.tpl");
    $footer->display("footer.tpl")
    =====================================================
Thanks in advance Best regards pt2002
-- .::....::.:...::...:..:.:::..:..:..::.:..:..:::..:::...::..:.. :: PUBLIC VOICE Lab :: Alexey Kulikov :: :: The International Media Coop :: alex@pvl.at :: :: www.pvl.at :: phone: +43 699 1 9228792 ::

« previous php.smarty.general (#9085) next »