-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[BUG] accessControlProvider cacheTime does not seem to be working #6749
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
Comments
I want to work on this issue, kindly assign the bug |
This comment has been minimized.
This comment has been minimized.
Hello @omerdn1, Thanks for the detailed explanation Actually, TanStack Query already has a very good caching mechanism. If you’re making repeated requests, it’s probably because the query key is changing. For example, you’ll be making requests again and again for different resources because the query key changes. I don’t think this is a bug but rather an issue in your implementation. If you share a reproducible example, I can help debug it. |
Describe the bug
Hi, I have the following Refine setup:
When I'm loading a page -- for example -- /printing-house, the
can
function runs every time for each resource and if the current route is wrapped withCanAccess
then it waits for the execution of thecan
function for all resources, which makes loading of pages very slow...I tried using
cacheTime
to cahce the results but does not seem to do anything. Thecan
function still runs for each resource and the slow behavior keeps occuring.Steps To Reproduce
Expected behavior
Resource control needs to be determined on first run and then cached for the cache time.
Packages
Additional Context
Additionally, I was wondering if there is a way to prioritize checking access for the current resource and then showing it immediately instead of having to wait for all the checks. That would solve the issue as well.
The text was updated successfully, but these errors were encountered: