まず protected/config/main.php に以下を追加。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
... | |
'components' => array( | |
'cache' => array( | |
'class' => 'CFileCache', | |
), | |
... | |
'db' => array( | |
... | |
'schemaCachingDuration' => 3600, // 秒 | |
), | |
... |
注意点としては、当たり前ですが、データベーススキーマを変更した場合 (カラムの追加や型の変更) 、不具合が出る恐れがあるので、例えば開発段階の場合は、キャッシュデータファイルを削除するなどの調整が必要になります。
0 件のコメント:
コメントを投稿