5

Is there a way to get a non-cached config value from Magento using Mage::getStoreConfig without having to first flush the entire config cache?

4

I do not believe this is possible.

You could look into querying the database directly for the value in core_config_data but you should really let Magento handle the full configuration and merging as the configuration is built on top of the xml files, and split into varying groups then cached.

If you want to handle this in a programmatic way you could call Mage::getConfig()->reinit() which should reinitialise the configuration object and re-cache it, while ignoring the current values in the cache.

https://github.com/OpenMage/magento-mirror/blob/1.9.3.9/app/code/core/Mage/Core/Model/Config.php#L363-L374

/**
 * Reinitialize configuration
 *
 * @param   array $options
 * @return  Mage_Core_Model_Config
 */
public function reinit($options = array())
{
    $this->_allowCacheForInit = false;
    $this->_useCache = false;
    return $this->init($options);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.