Next.js Discord

Discord Forum

cache components -> stale router cache

Unanswered
Yellow croaker posted this in #help-forum
Open in Discord
Yellow croakerOP
Hey. So has anyone used cache components?
I'm running into the following issue:

I'm using wordpress as the cms / backend for a project and wpgraphql for queries.
I have a revalidation api endpoint that im using as webhook on the server for revalidation
where i do on demand revalidateTag for a specific cacheTag. I'm using expire 0 as the second param which i thought would be the only thing needed. I also do revalidatePath("/", "layout") there

Then when I build and start. New cms content, refresh. Shows up. -> I navigate to another page -> i click my logo to go home (or browser back nav) -> Stale data (state before latest cms change).

Even subsequent navigations don't solve this. A second refresh IS ALWAYS needed for no stale data anywhere.

Has anyone had a similar experience?

Thing of note. I'm not using updateTag as that can't be used in Route Hanlers.

0 Replies