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

Per Request Cache #681

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Per Request Cache #681

wants to merge 9 commits into from

Conversation

gkmk
Copy link

@gkmk gkmk commented Aug 6, 2024

This would allow for in memory caching instead of pinging the "real" cache store each time. Noticed large number of requests when using Laravel Nova with Laratrust. When Nova is checking the policies (which check user permissions and roles) it makes 100+ requests which is unnecessary for single request.

Before

image
image

After

image
image

Captures from Laravel Telescope

gkmk added 9 commits August 6, 2024 12:44
Add another layer of in memory cache. Avoids pinging the "real" cache for the same request.
Same as with UserDefaultChecker, it avoids pinging the real cache multiple times for the same request.
Update RoleDefaultChecker.php
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 this pull request may close these issues.

2 participants