From f591017132192b6205420b58dd286da41d9a13bb Mon Sep 17 00:00:00 2001 From: Andrii Kasian <akasian@magento.com> Date: Thu, 17 Mar 2016 12:05:23 +0200 Subject: [PATCH] MAGETWO-47770: Category page triggers about 800 DB requests on calls without FPC --- app/code/Magento/Theme/Block/Html/Topmenu.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Block/Html/Topmenu.php b/app/code/Magento/Theme/Block/Html/Topmenu.php index 8b86ee29a86..0a7c43c2669 100644 --- a/app/code/Magento/Theme/Block/Html/Topmenu.php +++ b/app/code/Magento/Theme/Block/Html/Topmenu.php @@ -49,7 +49,6 @@ class Topmenu extends Template implements IdentityInterface TreeFactory $treeFactory, array $data = [] ) { - $this->setCacheLifetime(30 * 60); parent::__construct($context, $data); $this->_menu = $nodeFactory->create( [ @@ -60,6 +59,16 @@ class Topmenu extends Template implements IdentityInterface ); } + /** + * Get block cache life time + * + * @return int + */ + protected function getCacheLifetime() + { + return parent::getCacheLifetime() ?: 3600; + } + /** * Get top menu html * -- GitLab