1

I'd like to punch a hole in the full page cache for the top menu of a site. While digging through some Enterprise code, I see that the top menu has an existing hole punched:

//  app/code/coe/Enterprise/PageCache/etc/cache.xml
<catalog_navigation>
    <block>page/html_topmenu</block>
    <name>catalog.topnav</name>
    <placeholder>TOPMENU</placeholder>
    <container>Enterprise_PageCache_Model_Container_Catalognavigation</container>
    <cache_lifetime>86400</cache_lifetime>
</catalog_navigation>

However, I'd like to change the cache_lifetime to be much shorter (1 second). What is the best way to modify the cache_lifetime without modifying core code?

  • 1
    Why on earth do you want a 1s cache expiry?? – benmarks Jul 3 '13 at 17:52
  • To effectively disable caching the top menu. It's very... dynamic. – Ryre Jul 3 '13 at 17:54
  • This is the wrong way to go about it, I believe. I think if you pass <cache_lifetime /> you will get what you want. FWIW I can't imagine such dynamism to be good for the user or for search engines, but obviously I don't know your use case. – benmarks Jul 3 '13 at 18:02
  • B2B site that's closed to the world. SEO isn't a concern. They dynamic aspects weren't my idea. =/ – Ryre Jul 3 '13 at 18:23
2

I believe that if you declare a custom module as <depends> on <Enterprise_PageCache/> and create a cache.xml file which contains the following, you will effectively override the core cache_lifetime value:

<?xml version="1.0"?>
<cache>
    <catalog_navigation>
        <cache_lifetime>1</cache_lifetime>
    </catalog_navigation>
</cache>
  • 1
    Shouldn't catalog_navigation be wrapped in :<config><placeholders>? – MagePsycho Aug 2 '15 at 11:01

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.