Next.js Discord

Discord Forum

revalidateTag doesn't work properly when deployed to vercel

Unanswered
Pollock posted this in #help-forum
Open in Discord
PollockOP
Server action that triggers revalidation: https://github.com/odicho/mailer-web/blob/main/apps/web/src/app/api-keys/actions.ts#L37

unstable_cache usage: https://github.com/odicho/mailer-web/blob/main/apps/web/src/app/api-keys/page.tsx#L14

The problem is that I have to revalidateTag twice before it actually resets the cache and gets fresh data.


It works in localhost.

2 Replies

PollockOP
Bumping!
Yacare Caiman
I encounter the same issue, it's works on localhost production build, but not in Vercel. I my case I use api route as a webhook to call the revalidateTag. I have to visit the page that affected by the revalidateTag before calling the revalidate webhook to make it works. But I still need to do hard refresh Cmd + Shift + R to see the fresh data.