Next.js Discord

Discord Forum

Purge the cache for a specific tag or path

Unanswered
Harlequin Duck posted this in #help-forum
Open in Discord
Harlequin DuckOP
Can I purge the cache for a tag or path?
Are there any good practices for this?

As far as I understand revalidateTag and revalidatePath only invalidate the cache, meaning the first user after calling those functions will still see old Data.

My Use Case:
I have an app, where I need to cache long running fetches (that already have there own revalidation). However, the data of those fetches changes drastically over night and no user on the next day, not even the first one alone should see the old data. So I need to make sure that over night the cache gets purged.

0 Replies