$smarty->caching = true; $smarty->cache_lifetime = 60; // 1 minute if ($smarty->is_cached('template.tpl')) { // template is cached and do something }
$smarty->caching = true; if ($smarty->is_cached('template.tpl', $_SESSION['language'])) { // template is cached for this language and do something }This example sets the caching to true and checks if the "template.tpl" is cached based on the language stored in the session variable. Package/Library: Smarty Template Engine.