Caching Policy permissions. For index page don't iterate through all policies. #6398
-
|
I'd like to revisit this issue previously reported. I'm experiencing the same performance problems. As more resources are added, the index page slows down. When scaling from 50 to 100 resources in a larger implementation, this becomes a major concern. Will this issue be addressed in the next version (v5)? Ideally, permissions should be cached rather than frequently read. Additionally, when accessing a resource index page, it seems unnecessary to recheck all the policies each time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I was able to solve this issue myself by overriding the authorization trait in Resource class. I found out that for each resource there are like 4 call to Policy if it exists and a call to create policy. By caching it, I was able to improve from 5 sec for 90 resources down to less than 1 sec. Hopefully future release will allow policy to be cache by session rather than calling it so many times. |
Beta Was this translation helpful? Give feedback.
I was able to solve this issue myself by overriding the authorization trait in Resource class. I found out that for each resource there are like 4 call to Policy if it exists and a call to create policy. By caching it, I was able to improve from 5 sec for 90 resources down to less than 1 sec. Hopefully future release will allow policy to be cache by session rather than calling it so many times.