Next.js Discord

Discord Forum

noStore() bug?

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I am learning next.js through the dashboard-project https://nextjs.org/learn/dashboard-app/static-and-dynamic-rendering, on chapter eight I added the noStore() function to the fetchRevenue() function, and I noticed that when I refresh the http://localhost:3000/dashboard page, and click into the invoices then click back Home which is the /dashboard url, it does not trigger the data fetching, however if I wait for like 3 minutes and click into invoices and click back in Home, it starts to fetch the data everytime I click back into the Home which is /dashboard, is this a feature of noStore()? my code is exactly same with the example code.

5 Replies

Siberian
Not 100% but I think the explanation here is that noStore() affects server side cache, what you're running into has to do with client side cache. If it was server side it also wouldn't refetch when you refresh the page, which as I understand does happen for you right now
I think in the lastest Canary version they added an option to set the stale time of client side cache in your Nextconfig