Reputation: 1211
I've got a very strange cache problem. IÄve got one store with two languages. When i change the language from German to English, it's working the first time. So when i'm on side A(German) it switches to A(English). But.... if I change the page or the category... in example, from A to B and THEN i switch the language again, it redirects me back to A and not to B.
It's a very strage cache problem. I deactivated all cache options and afterwards it works perfectly but I cannot run a shop without any cache possibilities:
here's my shop: http://www.livewire-clothing.de/packagedetails/ Check out the page code. Switch the language and the page and check the code again.
This part never changes:
<select id="select-language" title="Ihre Sprache" onchange="window.location.href=this.value">
<option value="http://www.livewire-clothing.de/merchandise/k.html?band=78&manufacturer=55&size=39&___store=de&___from_store=de" selected="selected">Deutsch</option>
<option value="http://www.livewire-clothing.de/merchandise/k.html?___store=en&band=78&manufacturer=55&size=39&___from_store=de">Englisch</option>
</select>
It must be the cache. Does someone got a solution for me or could help me out? Thank you very much.
Upvotes: 1
Views: 2708
Reputation: 2058
The problem is most likely that you put the language switcher in the footer block. The footer block in Magento has block caching activated. If you take a look at Mage_Page_Block_Html_Footer
, you will see a cache key defined (Magento 1.5):
public function getCacheKeyInfo()
{
return array(
'PAGE_FOOTER',
Mage::app()->getStore()->getId(),
(int)Mage::app()->getStore()->isCurrentlySecure(),
Mage::getDesign()->getPackageName(),
Mage::getDesign()->getTheme('template')
);
}
This means the block output will be cached in separate versions depending on the current store, design etc.
However, your language switcher links directly to the current page in each language. When the link is different for each page, your footer output will be different for each page. I would recommend simply disabling block caching for the footer block by overriding the block and remove the cache definitions, or by using a core/template block instead.
Upvotes: 3