is_cached() and clear_cache().
 确定传给is_cached()和clear_cache()的第二参数是同一个cache_id。 
 
Example 14-7. passing a cache_id to is_cached() 
例14-7.传给is_cached()一个cache_id 
 
require('smarty.class.PHP');
$smarty = new Smarty;
$smarty->caching = true;
$my_cache_id = $_GET['article_id'];
if(!$smarty->is_cached('index.tpl',$my_cache_id)) {
	// No cache available, do variable assignments here.
	$contents = get_database_contents();
	$smarty->assign($contents);
}
$smarty->display('index.tpl',$my_cache_id);
 | 
  
 
 | 
	You can clear all caches for a particular cache_id by passing null as the
	first parameter to clear_cache().
你可以通过把clear_cache()的第一参数设为null来为特定的cache_id清除所有缓存。 
	
Example 14-8. clearing all caches for a particular cache_id 
例14-8.为特定的cache_id清除所有缓存 
 
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->caching = true;
// clear all caches with "sports" as the cache_id
$smarty->clear_cache(null,"sports");
$smarty->display('index.tpl',"sports");
 | 
  
 
 | 
	In this manner, you can "group" your caches together by giving them the
	same cache_id.
 通过这种方式,你可以用相同的cache_id来把你的缓存集合起来。