Possible to revalidate sitemap.js using revalidateTag ?? #76932
Unanswered
CodeInVeins
asked this question in
Help
Replies: 1 comment
-
same issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hey everyone! 👋
In sitemap.js, inside the sitemap() function, let's say we have:
const posts = await getPosts({ page, pageSize });
Searched it, and found out that we can easily use
export const revalidate = x
to refresh the sitemap every x seconds, but I was wondering if it's possible to use revalidateTag for the tag we bind to getPosts?I have a webhook that triggers on-demand revalidation for getPosts's tag, but the sitemap doesn’t update. However, the revalidate directive still works.
Could it be that revalidateTag only works when the fetch is used inside a route/page? Or am I missing something?
Would appreciate any insights
Thanks
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions