Does anyone know how to disable data cache on vercel for Next.js
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
Project works well on local but after deploying on vercel, I can't see the changed data
After purging everything on vercel UI manually, I can see the changed data
also, I tried to add to my codebase according to the vercel doc
export const fetchCache = 'force-no-store';
const res = await fetch('https://example.com', { cache: 'no-store' });
But still couldn't resolve this problem
Any insight appreciated!
Thanks in advance
After purging everything on vercel UI manually, I can see the changed data
also, I tried to add to my codebase according to the vercel doc
export const fetchCache = 'force-no-store';
const res = await fetch('https://example.com', { cache: 'no-store' });
But still couldn't resolve this problem
Any insight appreciated!
Thanks in advance
31 Replies
Masai LionOP
@@ts-ignore
where do I add this?
@Masai Lion where do I add this?
in page.tsx
Masai LionOP
thanks, let me try
as I mentioned above, I added this one - export const fetchCache = 'force-no-store';
but it didn't work
anyway, let me try
Masai LionOP
@@ts-ignore
Hi, How are you?
Even though I add this into page.tsx, still couln't resolve that problem
can you create a minimal reproduction repository
Masai LionOP
OK, let me share it
Masai LionOP
@@ts-ignore
Masai LionOP
oh, we need to config the env
As you know, we don't have any cache problem in local env
no I mean the github url throws 404
Masai LionOP
oops, I created it privately
@@ts-ignore
this is public repo
@Masai Lion this is public repo
which page is it
Masai LionOP
app/page.js
@Masai Lion app/page.js
I don't see the export dynamic anywhere in it
Masai LionOP
removed it
didn't work
export const fetchCache = 'force-no-store';
export const dynamic = "force-dynamic";
export const dynamic = "force-dynamic";
it only works in server components, this is a client component marked with
use clientMasai LionOP
oh