Enable CDbCache and CDbCacheDependency

I am trying to optimise a query by applying cache on it. But even after running the query again and again their is no change and no YiiCache table is created in my database. I think my CDbCache is not configured properly or dependency is not working. Or suggest something else to optimise SQL queries in Yii.

This my configuration :

‘cache’=>array(

    'class'=>'system.caching.CDbCache',


    'connectionId'=>'db',

),

and i want to optimise this query:

$dependency = new CDbCacheDependency(‘SELECT MAX(id) FROM user_notification’);

$userNotificationModel = UserNotification::model()->cache(9000, $dependency)->findAllByAttributes(

    array(


        'status' => NotificationCronCommand::QUEUED


    )


);

P.S. - I have gone through all the general pages from Yii on caching.