How to enable caching in yii framework

Apologies, Its been while i have not written any blog as i was busy with yii framework. I am back with new stuff so that it i help you. This blog will explain you on how to enable caching in yii framework. Quick and easy steps to enable the caching.

Yii framework: Quick and easy steps to enable the caching in.

Step 1: Decide which caching type you want to use ?
The good thing about the Yii framework is it supports more than one type of caching technique. In this blog i am going to use explain on how to use “CFileCache”. which will cache the file into cache directly.

Step 2: How to enable caching
presuming that Yii framework is already installed. Go to the config directly of yii and open main.php file. You will see big array of php inside that add following set of lines and you are done with how to enable caching.

Note: Linux box, make sure cache folder has write permissions.

        //enabling yii caching, using file cache
        'cache' => array(
            'class' => 'system.caching.CFileCache'
        ),
Share this nice post: