0

我能够使用“CActiveDataProvider”在缓存中存储 auery,但它似乎不是从缓存中获取的,我做错了什么?

我的配置是:

'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',
        ),
    ));
4

0 回答 0