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?

asked Jul 3, 2013 at 17:27
4
  • 1
    Why on earth do you want a 1s cache expiry?? Commented Jul 3, 2013 at 17:52
  • To effectively disable caching the top menu. It's very... dynamic. Commented Jul 3, 2013 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. Commented Jul 3, 2013 at 18:02
  • B2B site that's closed to the world. SEO isn't a concern. They dynamic aspects weren't my idea. =/ Commented Jul 3, 2013 at 18:23

1 Answer 1

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>
answered Jul 3, 2013 at 17:56
1
  • 1
    Shouldn't catalog_navigation be wrapped in :<config><placeholders>? Commented Aug 2, 2015 at 11:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.