12

In Magento 2.2.4 CommunityOrEnterprise edition default menu not appear on home page when enabled Varnish Cache.

Actually problem is related to Varnish Cache if I set Varnish Cache from Store -> Configuration -> Advanced -> System -> Full page cache -> Caching Application Set to **Varnish Cache** then menu is not displaying.

If I set to 'Built-in cache' then it's working fine.

enter image description here

But on other all pages it's appear.

enter image description here

I checked and found that JS is not showing in inspect element on home page, so reason for this menu is not displaying.

in inspect element on home page showing like this

<esi:include src="http://127.0.0.1/rb-ee/page_cache/block/esi/blocks/%5B%22catalog.topnav%22%5D/handles/WyJkZWZhdWx0IiwiY21zX2luZGV4X2luZGV4IiwiY21zX3BhZ2VfdmlldyJd/"></esi:include>

Can anybody know it is necessary to select Varnish Cache (Magento Enterprise Edition 2.2.4) and what happens if we not select Varnish Cache?

Any help would be appreciated. Thanks.

8
  • Go to admin if cache enable then you can disable cache after check working ya not working ?
    – user68116
    Commented Jun 12, 2018 at 6:43
  • Thanks @PrashantPatel i was tried all basic configuration settings & run all related command. Commented Jun 12, 2018 at 6:54
  • The problem can be due to some JS error. Please check the browser's console for the errors and resolve accordingly to fix the issue. Commented Jun 12, 2018 at 7:03
  • 1
    This need to be REOPEN because it is occurring in Default Magento Theme. Commented Jun 14, 2018 at 6:06
  • 1
    maybe this helps magento.stackexchange.com/a/100128/146
    – Marius
    Commented Jun 19, 2018 at 10:52

4 Answers 4

3

This is an old M2 issue Varnish top navigation menu gone

Even then all roads lead to github where there are similar reports like https://github.com/magento/magento2/issues/3897 but the vanishing menu has been plaguing users forever in M2.

3

To resolve this problem, you can override the default.xml file and remove it inside the ttl tag of the topmenu block, this xml find in Vendor/Magento/module-theme/view/frontend/layout.

2
  • Can you please explain to me why TTL tag added in default.xml and what is the use of TTL tag and what happens if we remove TTL tag? Commented Jun 6, 2019 at 13:09
  • It serves to say if the block should be cached, then removing that tag from the topmenu block it will not be cached and will work again, I will see other better solutions, but this was the first one I found, to solve the problem Commented Jun 6, 2019 at 23:56
1

Because of Varnish it happens in latest Magento2.4.1 as well.. Why don't you follow the below steps to get this done?

Overwrite default.xml located at /vendor/magento/module-theme/view/frontend/layout/ search for ttl="3600" written inside " block and simple remove ttl="3600" It should work now

0

I was facing the same problem in my magento 2.4.6 instance. my menu is not coming and the block section is loading with a cache URL like this.

<esi:include src="http://basetheme.hww/page_cache/block/esi/blocks/%5B%22custom.navigation%22%5D/handles/WyJkZWZhdWx0IiwiY21zX2luZGV4X2luZGV4IiwiY21zX3BhZ2VfdmlldyJd/"></esi:include>

Problem: The problem was the ttl attribute in the block call in XML.

Solution: I have just removed the ttl="3600" attribute from the XML block call, which was fixed for my case.

Reference: https://community.magento.com/t5/Magento-2-x-Programming/Magento-2-2-4-EE-Menu-is-not-appear-on-home-page/m-p/533869#M15741

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.