Cache getBlockTypeByUuid

Created on 21 November 2022, over 2 years ago
Updated 28 May 2024, 11 months ago

Problem/Motivation

When opening layout builder, the restrictions check for each block if the user's role have permission to access this.
This calls getBlockTypeByUuid for each block available. This function does a DB call, which i saw being run 2000+ times in a project.
In this case i think it's because content blocks are also used and checked.

Steps to reproduce

Find a site where loading layout builders take long.

Proposed resolution

We can cache this function, so the DB query does not run 2K times.

Remaining tasks

Check if we can refactor things here to stop calling this method 2K times.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium mallezie Loenhout

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.71.5 2024