-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Cache issues #334
Comments
+1 for this.
If the user does not have any permissions, This can bring along some (relatively) heavy load espacially in loops. |
I am not sure if this is the intended way, however, it should work out.
I would think applying an |
Good catch! I would suggest something like this: if (null !== $found = cache("{$userId}_permissions")) Would you submit a PR for these changes? It sounds like the may be needed in multiple places. |
On its way :) |
Should be |
Yes! Sorry, I didn't look at the actual code, just the preview above. |
This is kind of beside the point but would anybody have interest in having the cache time moved to a config file? cache()->save("{$user->id}_groups", $cacheGroup, 300); cache()->save("{$user->id}_groups", $cacheGroup, $config->time); |
The framework recently added a default TTL value to the Cache Config. I think it would make sense for this library to use that (with the current as a fallback) so devs could change it centrally or on-the-fly. |
I would think so, too. |
Yes, agree. I think: this library should have its own Config option but should use |
I'm noticing that some of the methods don't allow a null array to be cached. In the group model if a user returns no groups then the empty array should be cached. To fix you can check if cached value !is_array() as follows. I'm sure there are many places this could be fixed.
The text was updated successfully, but these errors were encountered: