0

I have separate headers for different pages of our store. A different format is displayed based upon the page being visited. For example, the homepage is different than category pages. Occasionally the headers themselves cache over one another and this state is persistent until the cache is flushed.

What causes this and how can I fix it?

Enterprise Edition 1.9.

  • Magento's cache or the Browser's cache is having to be flushed? What cache storage engine are you using? Magento version? – B00MER Dec 22 '14 at 19:03
  • @B00MER Magento's cache. I put the version in the question. – easymoden00b Dec 22 '14 at 19:16
1

You should try this answer. Wrap your code in a block and set the block cache lifetime to 0 while calling it from an XML. If you are using $this->getChildHtml('header'); you can add false as the second parameter and the HTML will be fresh like this $this->getChildHtml('header',false);. That way your header block will be never cached.

  • Won't removing the header from cache cause significantly larger amounts of server load / response time (over thousands of page views). – easymoden00b Dec 23 '14 at 13:26
  • Yes. But that is what you asked. You can wrap only the part you want and use this approach if you don't want to disable the cache on everything in the header. – mbalparda Dec 23 '14 at 13:27
  • Well, thank you for your correct answer. Are you familiar enough to know what may be causing this to not 'just work'? – easymoden00b Dec 23 '14 at 13:32
  • What do you mean by not just work? – mbalparda Dec 23 '14 at 13:32
  • Why is it that the header is essentially not following the correct logic? I have an 'if' statement that checks the page and displays the correct contents, but in this case it occasionally doesn't work. – easymoden00b Dec 23 '14 at 13:42

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.