Query caching yii framework

后端 未结 1 1650
别那么骄傲
别那么骄傲 2020-12-20 02:32

I want to find the total score of the loggedin user & want to cache it. My code is:

$dependency = new CDbCacheDependency(\'SELECT MAX(id) FROM tbl_points         


        
1条回答
  •  萌比男神i
    2020-12-20 03:09

    the best way to find out that query results come from cache or database is that to turn on logging as follow and see the results

            'log'=>array(
                'class'=>'CLogRouter',
                'routes'=>array(
                    array(
                        'class'=>'CFileLogRoute',
                        'levels'=>'error, warning',
                    ), 
                    array(
                        'class'=>'CWebLogRoute',
                    ), 
    
                ),
            ),
    

    0 讨论(0)
提交回复
热议问题