Jump to content

Blocktopmenu very slow


Recommended Posts

Hello,
 
I am trying to speed up a slow prestashop site and after a lot of debugging I have found that the blocktopmenu module takes about 3 seconds to run the displaytop hook.
 
It is the makeMenu function that takes about 3 seconds but looking at the code it is supposed to cache it. However, it seems like the makemenu function is always runned and never taken from cache. I have made sure smarty cache is enabled.
 
Any ideas on how to solve this or debug further? I appreciate any help I can get!

 

Here is the code:

 

public function hookDisplayTop($param)
    {
        
        $this->user_groups = ($this->context->customer->isLogged() ?
            $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP')));
        $this->page_name = Dispatcher::getInstance()->getController();
        if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) {
            if (Tools::isEmpty($this->_menu)) {
                
                $this->makeMenu();
            }
            $shop_id = (int)$this->context->shop->id;
            $shop_group_id = Shop::getGroupFromShop($shop_id);

            $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH', null, $shop_group_id, $shop_id));
            $this->smarty->assign('MENU', $this->_menu);
            $this->smarty->assign('this_path', $this->_path);
        }
        
        
        $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId());
        return $html;
    }

Link to comment
Share on other sites

using FTP or hosting control panel file manager check that the module cache is being written.

 

cache/smarty/cache/blocktopmenu

 

there you should sub folders of cached block menu's.

 

If not then check your back office-->advanced parms-->performance and ensure  smarty cache is enabled.

 

If it is there it could be any number of things.  The higher quality paid themes have really nice menu logic and cache I am not sure about using default menu maker though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...