我能够在缓存中使用“CActiveDataProvider”存储查询,但看起来它不是从缓存中获取的,我做错了什么?
我的配置是:
'cache'=>array(
'class'=>'CFileCache',
),
控制器:
$dependecy = new CDbCacheDependency('SELECT MAX(id) FROM {{table}}');
$dataProvider = new CActiveDataProvider(Model::model()->cache(3600, $dependecy, 2), array (
'criteria' => array (
'order'=>'date DESC',
),
'pagination' => array (
//'pageSize' => '5',
),
));