Why so long request time for admin panel in Croogo/CakePHP?

狂风中的少年 提交于 2019-12-11 08:57:15

问题


I don't understand why I have so long request time for admin panel in Croogo CMS.

Printscreen for home administration panel (debug kit plugin):

How can I check what exactly causes that as long the page loads? Page view contains few elements, but loaded more than 4 seconds.

Thanks in advance!


回答1:


It seems to be taking the longest time in rendering the admin menus.

I've also experienced this and wrote a patch to cache the results. Replace Plugin/Croogo/View/Elements/admin/navigation.ctp with the following:

<nav class="navbar-inverse sidebar">
    <div class="navbar-inner">
    <?php
        $cacheKey = 'adminnav_' . $this->Layout->getRoleId() . '_' . $this->request->url . '_' . md5(serialize($this->request->query));
        $navItems = Cache::read($cacheKey, 'croogo_menus');
        if ($navItems === false) {
            $navItems = $this->Croogo->adminMenus(CroogoNav::items(), array(
                'htmlAttributes' => array(
                    'id' => 'sidebar-menu',
                ),
            ));
            Cache::write($cacheKey, $navItems, 'croogo_menus');
        }
        echo $navItems;
    ?>
    </div>
</nav>


来源:https://stackoverflow.com/questions/23639761/why-so-long-request-time-for-admin-panel-in-croogo-cakephp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!