Improve performance with option to do build time access checks instead of runtime checks

Created on 20 May 2022, about 2 years ago
Updated 11 April 2023, about 1 year ago

Problem/Motivation

Menu access checks are expensive. Let's see if we can bypass in some situations This is a pervasive problem through Drupal, in core, and in many contrib modules. This offers a new pattern to test on one contrib module first, and to get feedback, before proposing to the wider community.

If the menu being displayed is large, and should always have items that are accessible to anonymous users, we can do the access check at build time instead of at runtime. This has security concerns. So the proposal is not to completely bypass the access checks, but do them at build time.

If the menu is changed after this is set, anonymous users could end up with links in their menus that they don't actually have access to. Is there any harm with this? When they click on the link they'll get an access denied.

Steps to reproduce

All of our sites have very big menus (3 levels deep; over 300 menu items on average).This change cuts the entire page time by 1/3 to 1/2.

Proposed resolution

Remaining tasks

We should also add the runtime access check to hook_requirements.

User interface changes

A new option is available.

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States douggreen Winchester, VA

Live updates comments and jobs are added and updated live.
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