Move menu link rebuilding out of route rebuilding

Created on 6 June 2015, about 9 years ago
Updated 14 February 2024, 4 months ago

Problem/Motivation

When the router is rebuilt, MenuRouterRebuildSubscriber forces all menu links to rebuilt. This happens within the overall route rebuild process. It's also the cause of one of the test failures on #2480811: Cache incoming path processing and route matching β†’ .

Route rebuilding should definitely invalidate the menu links, but I'm not convinced we should do the actual rebuilding within the route rebuild.

The reasoning for this is that any submission that doesn't return a fully-themed HTML response (form POST submissions, REST, private files, image derivatives etc.) need the router to be rebuilt, but they don't need the menu links.

Therefore, if we allow the route rebuild to complete and release the lock faster, we could then start serving those kinds of responses after a route rebuild - 350ms faster with the standard install profile, but likely much more on real sites.

Proposed resolution

Add the ability to mark the menu links as needing rebuild, probably via a state entry. Set this during router rebuild, but then do the menu link rebuilding when that service is actually requested.

Remaining tasks

Decide whether this is desirable or not then implement if so.

User interface changes

None.

API changes

Possibly.

πŸ“Œ Task
Status

Closed: works as designed

Version

9.5

Component
Menu linkΒ  β†’

Last updated about 1 month ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024