-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Post Cache #352
Comments
If the body of the post is the same, it will attempt to cache it. Try const {post} = useFetch(`/hello?q=${new Date().getTime()}`, { cachePolicy: 'no-cache' }) |
Yes that works, thank you, but should POST/PUT/DELETE be cached by default at all? |
This is great feedback. I agree, I think we should put this into effect. Will get to it as soon as I can. |
Would be great if this was documented and really visible. I have spent several hours figuring out what was wrong with my app. And yes, I'm not the most clever developer out there. But still. |
This is still relevant, we ran into the same issue |
Interested in this, not caching post, put, delete requests is probably correct but also if you continue to cache get requests (depending on your api) you might still be broken since you wont get the new data you just created... i solved this in a very brute force way by clearing the entire cache after every time I put,post or delete... this makes it so subsequent gets get the new data but also clears out apis that might not have new data... but "might not have" is correct... theres no real way for use-http to understand what your api mightve changed... cache invalidation is difficult lol |
I guess if we had access to the cache from inside the response interceptor we could just clear it if |
We just ran into this issue as well. I would not expect |
Describe the bug
Hi, I was just about to use this package, but somehow I'm stuck with creating a button that should execute a "post" on a specific route. But the post is only executed once, unless I refresh the page or change a query parameter.
Am I doing something wrong or is this possibly a bug. Thanks for the work!
The text was updated successfully, but these errors were encountered: