Reputation: 1725
Running next build
with output: "export"
caches the API calls, meaning any changes do not appear in the resulting static files. Is there any way to disable the caching, or get new data when running the build?
setup:
output: "export"
next build
issue:
out
folder is staleUpvotes: 0
Views: 553
Reputation: 1387
Problem :
Is there any way to disable the caching, or get new data when running the build?
Possible Cause :
Possible Solution :
Set the cache option for individual fetch requests to 'no-store' :
fetch('https://...', { cache: 'no-store' })
Set Route Segment Config Options in your layout.tsx/js or page.tsx/js or route.ts/js (add this line at top of the file) :
export const fetchCache = 'force-no-store'
Please Read :
If you have any doubts, then please leave a comment (I will update answer if necessary)
Upvotes: 0