I have been profiling some pages and after clearing cache there is a really slow response from: Locale/Currency
I am not too sure why it is taking so long. Here is the profiler entry:
Here is the time it takes:
I have been profiling some pages and after clearing cache there is a really slow response from: Locale/Currency
I am not too sure why it is taking so long. Here is the profiler entry:
Here is the time it takes:
I came up with a solution for this in the end. I think the slow speeds stems from loading each locale in full every time it needs to get some simple information about the store.
I created my own method since all i need is the currency, symbol and URL of the store. This made things significantly quicker.
public function getSpeedyCurrencyData()
{
$data = array();
$codes = explode(',', Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_ALLOW));
foreach ($codes as $code) {
$data[$code]['url'] = Mage::helper('directory/url')->getSwitchCurrencyUrl(array('currency' => $code));
$symbol = Zend_Locale_Data::getContent('en_GB', 'currencysymbol', $code);
if (!$symbol) {
$symbol = $code;
}
$data[$code]['symbol'] = $symbol;
}
return $data;
}