I have not tested this, but you can try to define something like
'cache'=>array(
'class'=>'system.caching.CFileCache',
),
'memcache'=>array(
'class'=>'system.caching.CMemCache',
),
Then you should be able to do
Yii::app()->memcache->set('user2', $user);
Yii::app()->memcache->get('user2');
I really have not tried this but considering how you define db connections and other things in Yii this should work.