cache the main navigation menu

Bug #1467368 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon
15.10
Fix Released
Undecided
Unassigned

Bug Description

Part of rendering the main navigation is it checks all the plugins to see if they want to add to the menu.

This is not an ideal way of doing it. We should cache the main menu's $menu array in the database after first render and just use that.

We should also have a clear_menu_cache($institution = null) function so that when the site or and institution updates it's config the related cached menus are cleared and able to generate again.

We should also clear the menu cache when plugins are installed / removed / hidden / shown

Tags: performance
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4887

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/4899

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4887
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/ec41d0e056a5268e27b28b4198a0f696c7c47226
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit ec41d0e056a5268e27b28b4198a0f696c7c47226
Author: Robert Lyon <email address hidden>
Date: Mon Jun 22 15:56:51 2015 +1200

Bug 1467368: Allowing the main menu structure to be cached

This will allow the rendering of the main nav to use less resources.

The cached menus are saved for each institution into the
institution_config table for these types of menus:

adminnav - site administration navigation
instadminnav - institution admin navigation
staffnav - site staff admin navigation
inststaffnav - institution staff admin navigation
standardnav - navigation seen in normal section of site

To clear cache menus call clear_menu_cache($institution)

Change-Id: I3b58090830b6d28f10f24e23abeef775c6863aa5
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Produces a modest improvement in speed & reduction in resource usage, on our testing cluster.

Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 15.10.0 → 16.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/4899
Committed: https://git.mahara.org/mahara/mahara/commit/a2459daa1240664a39a13edafbac625de3aae40b
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit a2459daa1240664a39a13edafbac625de3aae40b
Author: Jinelle Foley-Barnes <email address hidden>
Date: Tue Jun 23 17:40:08 2015 +1200

Behat Test: Menu navigation as different users (Bug 1467368).

Change-Id: I520abf1434d464928bdafa4ebb49603212b707e0

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.