本文介绍了为什么在Croogo / CakePHP的管理面板这么长的请求时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么我在Croogo CMS中对管理面板这么长的请求时间。

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):

如何检查究竟是什么原因,只要页面加载?页面视图包含少量元素,但已加载超过4秒。

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

提前感谢!

推荐答案

在渲染管理菜单方面似乎花费的时间最长。

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

我也遇到过这个问题,并写了一个补丁来缓存结果。将 Plugin / Croogo / View / Elements / admin / navigation.ctp 替换为以下内容:

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>

这篇关于为什么在Croogo / CakePHP的管理面板这么长的请求时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 03:14