以下是我在 Yii 中的数据库缓存的配置代码
'dbcache'=>array(
'class'=>'system.db.CDbConnection',
'connectionString'=>'sqlite:/' . str_replace('\\','/',str_replace('C:\\','',getcwd()).'/protected/data/cache.db'),
),
以下是我在缓存中获取记录集和设置的代码:
$recordset = Table1::model ()->cache(0)->find ( "primary_id=:id", array (":id" => $id) );
我使用0作为缓存持续时间,因为我需要让它无限期。现在我需要刷新我的缓存。在某种条件下。如果持续时间是无限的,如何刷新 Yii 中的查询缓存。请帮忙 :)