You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
IPermissionProvider.GetPermissionsAsync() on all implementations is called on every admin request by AdminMenuPermissionService in OrchardCore.AdminMenu if any of the AdminMenu nodes have any permissions configured:
This can be a performance issue if the permission provider does anything more involved, like the one in Queries (before #16402), in Secure Media (what uses caching due to this), or Roles.
An approach, but surely not the best one, is to cache in every provider that does non-trivial work. like SecureMediaPermissions does. This is viable, and as that provider also shows, may be necessary due to the variety of how such caching, and especially cache invalidation should be done.
A better one would be to cache on a higher level, though then invalidation becomes an issue.
Once done, the caching in SecureMediaPermissions can be removed.
Describe alternatives you've considered
Keeping everything as it is for now, since this doesn't seem to be a big enough deal yet.
The text was updated successfully, but these errors were encountered:
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).
This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.
I don't think it makes sense add an additional cache for permissions. Each provider has it's own needs and only a few (one at the moment) will have additional caching requirements. All other providers are already using cached data to generate the permission instances.
If we don't add a global cache for permissions, we should set all _allPermissions properties and similar one in Permission providers to static to avoid having to create so many object on every request to reduce memory allocation and reduce garbage collection.
Is your feature request related to a problem? Please describe.
IPermissionProvider.GetPermissionsAsync()
on all implementations is called on every admin request byAdminMenuPermissionService
inOrchardCore.AdminMenu
if any of the AdminMenu nodes have any permissions configured:OrchardCore/src/OrchardCore.Modules/OrchardCore.AdminMenu/Services/AdminMenuPermissionService.cs
Lines 28 to 33 in 6312841
Also see https://github.com/OrchardCMS/OrchardCore/pull/15173/files#r1536280664 and #16402 (comment) for context.
Describe the solution you'd like
An approach, but surely not the best one, is to cache in every provider that does non-trivial work. like
SecureMediaPermissions
does. This is viable, and as that provider also shows, may be necessary due to the variety of how such caching, and especially cache invalidation should be done.A better one would be to cache on a higher level, though then invalidation becomes an issue.
Once done, the caching in
SecureMediaPermissions
can be removed.Describe alternatives you've considered
Keeping everything as it is for now, since this doesn't seem to be a big enough deal yet.
The text was updated successfully, but these errors were encountered: