I’ve come across similar questions on Stack Overflow, but none of the solutions worked for me.
I’m looking to create an XML sitemap for my website, which has a Django-Rest-Framework backend and a Next.js frontend. I’m considering two options:
- Generating a sitemap using django-sitemap on the backend and then routing the URL to be displayed in
https://mywebsite/sitemap.xml
on the Frontend. - Fetching the list of all articles and courses from the API, which is paginated with a max limit of 100. This would require multiple calls to the list API to generate the sitemap on the Frontend.
I’m unsure about which option is the best choice. Is fetching the list of objects from the API suboptimal? How do large websites like Stack Overflow generate their sitemaps?
I’d appreciate any guidance and please let me know if I’m on the wrong track.