#refresh server fetch
1 messages · Page 1 of 1 (latest)
Hi @little coral. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Next.js automatically caches data returned from fetch in the Data Cache. If you want to force a fetch request to bypass the cache and get the most recent data, you can use the cache option with the value no-store or force-no-store in your fetch request. Here's an example:
const res = await fetch('<https://example.com',> { cache: 'no-store' });
This will ensure that the fetch request does not use the cache and always gets the latest data from the server.
If you want to disable fetch caching for your entire Next.js application, you can do so by exporting fetchCache with the value force-no-store:
export const fetchCache = 'force-no-store';
In some cases, you might need to delete all cached data and force revalidation. You can do this by purging the Data Cache from your Vercel project settings. Here are the steps:
- Under your project, go to the Settings tab.
- In the Data Cache section, select Purge Everything.
- On the dialog, confirm that you wish to delete and click the Continue & Purge Everything button.
Please note that purging your Data Cache will create a temporary increase in request times for users as new data needs to be refetched.