Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues from always reading roles from cache #79

Open
jcart opened this issue Jul 29, 2021 · 0 comments · May be fixed by #87
Open

Performance issues from always reading roles from cache #79

jcart opened this issue Jul 29, 2021 · 0 comments · May be fixed by #87

Comments

@jcart
Copy link

jcart commented Jul 29, 2021

Using this package that relies strictly on external cache to retrieve the roles, even after they have been retrieved from cache from previous calls.

This negates any possibility of eagerly loading the data from an initial query, in cases where collections are returned, which is very important.

$user = User::with('roles')-get();
$user->hasRole( .. );
$user->hasRole( .. );

This results in 2 cache retrievals from your external cache.

We have in some cases some complex permission schemes within a collection, which results in hundreds of calls to Redis.

An older version of the application does not suffer from this issue, but I'm not clear why you opt'd to always visit the external cache over in memory. See 4860bc0

@jcart jcart changed the title Performance issues Performance issues from always reading roles from cache Jul 29, 2021
@httpoz httpoz linked a pull request Aug 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant