Sitemap not updating when a new article is published
Unanswered
Nile Crocodile posted this in #help-forum
Nile CrocodileOP
I use Sanity as my CMS and I have a couple of sitemaps that read data from it in order to construct the sitemap. I have
The
So I'm not really caching anything (to my knowledge), so I am kind of lost why it wouldn't update.
export const dynamic = 'force-dynamic' in the file, yet I have to redeploy my app whenever I publish a new article for it to show up in my sitemap.The
getPostsForSitemap() function in the file looks likeexport function getPostsForSitemap() {
return client.fetch<SitemapContent[]>(
`*[_type == 'post' && defined(slug.current)]{
_id,
_updatedAt,
publishedAt,
"slug": slug.current,
}`,
{},
{ token, perspective: 'published' },
)
}So I'm not really caching anything (to my knowledge), so I am kind of lost why it wouldn't update.