You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish i was able to prerender while keeping headers like content-type 'application/xml'.
I have a lot of urls and i have to have a complete sitemap refering to all of them.
Adding them manually would be insanity, i solve this by having sitemapIndex.xml/+server.ts as a sitemap index, refering to 30 different sitemaps categorizing all our links.
I can prerender this dynamic route by adding this to svelte.config.ts prerender: { entries: [ '*', '/sitemap.xml/slug', // And so on ],
Voila! my entire one million website has a complete sitemap, it's prerendered so only have to NUKE the database at build time 👯 👯
But then the issue arrives, prerendering doesn't keep the headers and content type 😢
This also happens for any other .xml file you try to prerender.
This is a normal .xml file before prerender:
After prerender:
I took a look into my .svelte-kit/output/prerendered/pages/sitemap.xml and there's no header info in it, therefore the browser has no idea it's an xml.
Describe the proposed solution
Allow you to spesify what headers to have on prerendered stuff 🤔
I don't know, i'm not that good at this, mabye it already exists? If it's possible it's not documented as far as i could see in the docs.
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Describe the problem
I wish i was able to prerender while keeping headers like content-type 'application/xml'.
I have a lot of urls and i have to have a complete sitemap refering to all of them.
Adding them manually would be insanity, i solve this by having sitemapIndex.xml/+server.ts as a sitemap index, refering to 30 different sitemaps categorizing all our links.
I can prerender this dynamic route by adding this to svelte.config.ts
prerender: { entries: [ '*', '/sitemap.xml/slug', // And so on ],
Voila! my entire one million website has a complete sitemap, it's prerendered so only have to NUKE the database at build time 👯 👯
But then the issue arrives, prerendering doesn't keep the headers and content type 😢
This also happens for any other .xml file you try to prerender.
This is a normal .xml file before prerender:
After prerender:
I took a look into my .svelte-kit/output/prerendered/pages/sitemap.xml and there's no header info in it, therefore the browser has no idea it's an xml.
Describe the proposed solution
Allow you to spesify what headers to have on prerendered stuff 🤔
I don't know, i'm not that good at this, mabye it already exists? If it's possible it's not documented as far as i could see in the docs.
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: