My store was extremely slow on the product pages and after a little bit of debugging I found that the product swatches were causing the problem.
I've checked the server error log and the max_execution_time
exceeds with the following code snippets:
/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php
public static function normalizeKey($key) {
if (function_exists('mb_strtolower')) {
return trim(mb_strtolower($key, 'UTF-8')); // The line the error refers to
}
return trim(strtolower($key));
}
/app/code/core/Mage/ConfigurableSwatches/Helper/MediaFallBack.php
$optionLabels = array_map(function ($value) {
return array_map('Mage_ConfigurableSwatches_Helper_Data::normalizeKey', $value); // Error
}, $optionLabels);
My client does prefer to have the swatches enabled on the site and the swatches are used for three attributes, but how can I solve the executing time problem or just generally speed up the swatches?
I'm using Magento 1.9.1 with the default swatches and the site runs on an nGinx server