Calling Mage::getStoreConfig
automatically uses Magento cache.
It uses the getConfig
method from Mage_Core_Model_Store
which as you can see return the value from the cache if set:
public function getConfig($path)
{
if (isset($this->_configCache[$path])) {
return $this->_configCache[$path];
}
$config = Mage::getConfig();
$fullPath = 'stores/' . $this->getCode() . '/' . $path;
$data = $config->getNode($fullPath);
if (!$data && !Mage::isInstalled()) {
$data = $config->getNode('default/' . $path);
}
if (!$data) {
return null;
}
return $this->_processConfigValue($fullPath, $path, $data);
}
The $_configCache
is initiated via the initConfigCache
method from Mage_Core_Model_App
which is itself called during the _initStores
method. If we continue, the _initStores
method is called during the _initCurrentStore
, itself called when Mage::run
is called.