After further inspection of the new menu system, it seems like menu_tree_all_data() is cached separately for every path.

However, admin menu keeps the same on all pages, so we can shortcut the regular behavior of the menu system by using an own cache.

Known issues:

* Major: destinations in query strings are wrong.

* Major: user counter is not updated.

* Minor: Devel's switch user list is not updated. Note that this issue will be fixed via another issue in the queue anyway.

Regarding the destination query strings, I would not mind to turn this into a JS-only feature - i.e. instead of hard-coding query string destinations into the menu, we just add "destination=" to the link, apply a CSS class "admin-menu-destination", and inject the proper destination for the current page via JavaScript.

The user counter could use a similar approach, but that would need to be more flexible anyway to let #345984: Client-side caching of administration menu happen.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Version: 6.x-1.x-dev » 6.x-3.x-dev
sun’s picture

Status: Needs review » Needs work
FileSize
1.24 KB

Initial patch for 6.x-3.x. smk-ka has a patch for 5.x-3.x already, which dynamically appends the "destination=" query string to selected menu items in the cached output.

sun’s picture

Status: Needs work » Needs review
FileSize
8.55 KB

Updated patch for 5.x-3.x by smk-ka and me.

Adds dynamic replacement of destination query string in cached menu items.

sun’s picture

Status: Needs review » Fixed
FileSize
7.53 KB

Committed attached patch to all 3.x branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gnindl’s picture

Version: 6.x-3.x-dev » 6.x-1.8
Status: Closed (fixed) » Needs review
FileSize
2.85 KB

As there hasn't been a stable release for the 3.x-dev version for years, I'd like to open this issue fro 1.x. This patch increases further the performance by caching the output of the admin menu tree by user and language. On our installation we gain a 300 to 400 ms (APC caching)! Additionally there's an option to turn caching off.

Status: Needs review » Needs work

The last submitted patch, admin_menu-caching-1.8-patched1.patch, failed testing.

sun’s picture

Version: 6.x-1.8 » 6.x-3.x-dev
Status: Needs work » Closed (fixed)

I'm glad you were able to improve the performance of 1.x, but 1.x really won't see any further development unless strictly necessary.

There'll be a stable 7.x-3.0 release as well as a new 6.x-3.0-alpha5 release very soon. Speaking of, the 6.x-3.x is known to work for many users. It's merely a giant hack, and so I feel extremely uncomfortable with making a stable release (as that means the giant hack would be officially supported).