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.
In the current implementation, when validating permissions for workspace saved objects, the system needs to call bulkGet for each workspace saved object to retrieve its permission information. This process results in numerous duplicate requests for the same workspace saved objects, leading to performance inefficiencies during the permission validation logic.
Describe the solution you'd like
To address this issue and improve performance, we propose implementing a caching mechanism for workspace saved objects during the permission validation process. By caching and reusing the bulkGet results within the same request, we can significantly reduce the number of redundant calls and optimize the permission validation logic.
The proposed solution involves the following three main changes:
Add saved objects cache-related methods in the permission control client
Introduce the following methods in the permission control client:
cacheSavedObjects(request, savedObjects): This method will mark the provided saved objects as cacheable for the given request, meaning that the bulkGet results for these saved objects will be cached. The permission control client can then use the cached data instead of fetching it from the network.
clearSavedObjectsCache(request): This method will clear all cached saved objects for the given request.
isSavedObjectsCacheActive(request): This method will check if there are any existing cached saved objects for the given request.
Cache workspace saved objects during bulk operations
Modify the workspace saved object client wrapper to call cacheSavedObjects with the saved objects' workspaces during bulkCreate, bulkUpdate, and bulkGet operations.
This change will ensure that the workspace information is cached during the same request, eliminating the need for duplicate bulkGet calls for workspaces.
Clear saved objects cache before responding
Register a pre-response hook in the workspace plugin's permission setup logic.
Within the pre-response hook, call isSavedObjectsCacheActive to check if there are any cached saved objects.
If cached saved objects exist, call clearSavedObjectsCache to clear the cache before responding to the request.
By implementing this caching mechanism, we can significantly reduce the number of bulkGet calls made during the permission validation process, thereby improving performance and optimizing the overall system efficiency.
Is your feature request related to a problem? Please describe.
In the current implementation, when validating permissions for workspace saved objects, the system needs to call bulkGet for each workspace saved object to retrieve its permission information. This process results in numerous duplicate requests for the same workspace saved objects, leading to performance inefficiencies during the permission validation logic.
Describe the solution you'd like
To address this issue and improve performance, we propose implementing a caching mechanism for workspace saved objects during the permission validation process. By caching and reusing the bulkGet results within the same request, we can significantly reduce the number of redundant calls and optimize the permission validation logic.
The proposed solution involves the following three main changes:
By implementing this caching mechanism, we can significantly reduce the number of bulkGet calls made during the permission validation process, thereby improving performance and optimizing the overall system efficiency.
Describe alternatives you've considered
N/A
Additional context
#4944
#6051
The text was updated successfully, but these errors were encountered: