Sitemaps - Is there something fundamental i'm misunderstanding about sitemaps?
Hello!
I'm currently exploring how to best generate dynamic sitemaps for a Next.js-powered website. I stumbled upon the next-sitemap package (https://www.npmjs.com/package/next-sitemap), which seems like a robust solution for my needs. I can either use this package or handcraft the XML, but I'm leaning towards the former for convenience.
Here's a snippet of what my sitemap generation looks like:
Could someone clarify when this code is actually executed? I know getServerSideProps runs server-side on each request, but does this mean that a user or a search engine bot needs to navigate to /server-sitemap-index.xml for the sitemap to be generated? What if that never happens or takes a long time? I am a bit confused on how this'll work in practice. Appreciate any insights!
0 Replies