Caching sitemap/[id].xml route
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
Hey y'all I have a dynamic sitemap.xml and I have to download a large file every time a new id comes in to know what chunk from the file to receive.
I'm using vercel storage is there a way to not have to download this large file every request and only download this once on build time?
I'm using vercel storage is there a way to not have to download this large file every request and only download this once on build time?
14 Replies
Sun bearOP
tagging in my long lost friend @Jboncz
Will take a look after work. I think you could do this pretty easily.
Sun bearOP
❤️
So give me some mock code of how you generaling your sitemap
When you say when a new id comes in, do you mean somethings hitting an endpoint or what?
Sun bearOP
yeah something hitting the endpoint
@Jboncz
like ideally I'd like all these pages generated at build time
maybe it's just generateStaticParams
That isnt a thing in appRouter I think?
Sun bearOP
might not be haha
claude says its available in app router
Sun bearOP
how are you doing?
Sun bearOP
export const dynamic = 'force-static'
export const revalidate = false
btw
export const revalidate = false
btw
generateStaticParams
and these vars worked.