return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Yii Playground on Nicolas Machine',
// preloading 'log' component
'preload'=>array('log', 'dbManager', 'uiSettings', 'lc'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
...
My question is what is "preload" exactly. Does it mean yii read the class file(e.g.: dbManager.php) and store the content in server memory? How to determine if a component should preload?
Without preloading an application component, it will only be instantiatet on first access. This saves ressources, because in some requests a component isn’t touched at all, so it’s never created.
Usually the only component you want to preload is log. This is done to make sure, that the log router can do it’s job and output something on every request, even if the log component isn’t accessed at all.