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
    Commented Dec 22, 2014 at 19:03
  • @B00MER Magento's cache. I put the version in the question. Commented Dec 22, 2014 at 19:16

1 Answer 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). Commented Dec 23, 2014 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
    Commented Dec 23, 2014 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'? Commented Dec 23, 2014 at 13:32
  • What do you mean by not just work?
    – mbalparda
    Commented Dec 23, 2014 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. Commented Dec 23, 2014 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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