问题
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