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.
Comments
Comment #2
mallezieThis patch caches the getBlockTypeByUuid function in a memory cache.
Comment #4
nginex commentedComment #5
nginex commented