useFetch data is not being cached anymore
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.14.2
- Nuxt Version:
3.0.0-rc.14-27802701.2f53495
- Nitro Version:
0.6.2-27796963.837f894
- Package Manager:
npm@8.8.0
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-ccqtvp?file=pages%2Fabout.vue,pages%2Findex.vue,package.json
As you can see, on rc.14 edge
if you click “Go to about page” then “Go to home”, you will see that the data will be fetched again.
If you change to rc.13
, the data won’t be fetched again, loading from cache.
Describe the bug
Everytime useFetch
is being called, it ma dke a new request, it is not checking for the fetched cached data, as it used to be working by rc.13
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
useFetch
Stops making more requests if there is no more data to fetch. (i.e. if we have 25 todos, and the perPage is 10,...
Read more >useFetch in Nuxt3 keeping cached data - vue.js - Stack Overflow
when I move away from the page and come back, the new data is not loaded, instead it still shows the old data....
Read more >React Hooks SWR: Fetch, Cache and ReValidate server data ...
We'll see how to use SWR to improve the User Experience of our applications.We'll be using the following techniques in this tutorial:- cache...
Read more >@codecolde/use-fetch - npm
Use-Fetch. A very simple react hook. The goal is to fetch data from a url and optionally store it in the browser using...
Read more >React Query 3: A Guide to Fetching and Managing Data
For every API endpoint, you'll need to deal with state management, synchronization, caching and error handling. In this article, you'll learn ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve wasted some time today trying to figure out why i was seeing data refetched on back and forth page navigation hehehe. Thought i was going insane and broke something in my datafetching. I thought the built in caching was awesome!
That would be a lot of boilerplate code instead of a one-liner, @danielroe… Is this cache removal a final design decision or it is related to the ongoing discussion on #7569? 🙂