is_cached <methodsynopsis> <type>bool</type><methodname>is_cached</methodname> <methodparam><type>string</type><parameter>template</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> </methodsynopsis> <para> This returns &true; if there is a valid cache for this template. This only works if <link linkend="variable.caching">caching</link> is set to true. </para> <example> <title>is_cached caching = true; if(!$smarty->is_cached("index.tpl")) { // do database calls, assign vars here } $smarty->display("index.tpl"); ?> ]]> You can also pass a cache id as an optional second parameter in case you want multiple caches for the given template. is_cached with multiple-cache template caching = true; if(!$smarty->is_cached("index.tpl", "FrontPage")) { // do database calls, assign vars here } $smarty->display("index.tpl", "FrontPage"); ?> ]]>