-
Hi all, I'm new to Vercel and I try to use Vercel with a React website and for the time being without NextJS. The backend for my website updates daily a XML sitemap from a database and I need to find a way how i can offer the XML sitemap through the frontend. Vercel Support suggested to use a serveless API that could get the XML information from the backend and cache it for a day. The frontend would than "route" /sitemap.xml to the the API. They could however not give me any more detail or links to relevant documentation. Does anyone have an idea how to accomplish this or is Vercel not the right platform for this? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You run a Serverless Function that generates a sitemap.xml in If you want it to be visible in For example, vercel.json:
Refer to the function directly instead of generating file |
Beta Was this translation helpful? Give feedback.
You run a Serverless Function that generates a sitemap.xml in
/api
:https://vercel.com/docs/serverless-functions/introduction
If you want it to be visible in
/sitemap.xml
:https://vercel.com/docs/configuration#project/rewrites
For example, vercel.json:
Refer to the function directly instead of generating file
sitemap.xml
. Vercel has a cache feature that you can take advantage of:https://vercel.com/docs/edge-network/caching