FOUR-32256: PERF Reduce duplicate permission queries on menu and auth checks - #8914
FOUR-32256: PERF Reduce duplicate permission queries on menu and auth checks#8914gproly wants to merge 4 commits into
Conversation
…nd add the reason for the delay in the pages mentioned.
Description:
Reduce duplicate permission queries on menu and auth checks.
Cache permission names via Permission::cachedNames() and user permission
groups via User::cachedPermissionGroups(), with invalidation through
PermissionCacheService. Replaces repeated permissions()->pluck('group')
and Permission::all() calls in GenerateMenus, User, and AuthServiceProvider.
Going forward: memoize repeated reads per request with once(), batch
related data with eager load/preload, and use Cache::remember only for
cross-request data with explicit invalidation on writes.
Related tickets:
https://processmaker.atlassian.net/browse/FOUR-32256
|
QA server K8S was successfully deployed https://ci-0a93bd2386.engk8s.processmaker.net |
|
QA server K8S was successfully deployed https://ci-0a93bd2386.engk8s.processmaker.net |
|
QA server K8S was successfully deployed https://ci-0a93bd2386.engk8s.processmaker.net |
|
|
QA server K8S was successfully deployed https://ci-0a93bd2386.engk8s.processmaker.net |
PR SummaryMedium Risk Overview Permission names now load through User permission groups are cached for 24h via Unit tests cover that Reviewed by Cursor Bugbot for commit 5ac4c17. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
QA server K8S was successfully deployed https://ci-0a93bd2386.engk8s.processmaker.net |





Description:
Reduce duplicate permission queries on menu and auth checks.
Cache permission names via Permission::cachedNames() and user permission groups via User::cachedPermissionGroups(), with invalidation through PermissionCacheService. Replaces repeated permissions()->pluck('group') and Permission::all() calls in GenerateMenus, User, and AuthServiceProvider.
Going forward: memoize repeated reads per request with once(), batch related data with eager load/preload, and use Cache::remember only for cross-request data with explicit invalidation on writes.
Related tickets:
https://processmaker.atlassian.net/browse/FOUR-32256
ci:package-dynamic-ui:feature/FOUR-32256
ci:package-projects:feature/FOUR-32256
ci:package-savedsearch:feature/FOUR-32256
ci:deploy