-
Notifications
You must be signed in to change notification settings - Fork 75
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
Disable swrv for certain endpoints #356
Comments
You would need to provide an example of how you’re using swrv in your project. swrv doesn’t automatically “bind” to every request in your app, etc. |
This is a Vue3 application, and in the base API class SWRV is being hooked into all calls like this:
If keys is |
The easiest way would be to just provide a dynamic Since the cache key will be different on every request, it won't read from the cache. |
But doesn't that mean that the cache will then be polluted with all kinds of irrelevant hash key values, since I am assuming that when the call returns it will be adding the key- value (url - response) to the cache? |
You could also override the cache provider for URLs that match a certain syntax, or set the |
I would like to be able to disable swrv for certain endpoints, is that possible?
For example, all calls to
/api/comments
should simple passthru and always make remote api calls.Or is there an easier way to do this with
useSWRV()
?The text was updated successfully, but these errors were encountered: