Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prerender work for non html #10917

Closed
rossvold opened this issue Oct 24, 2023 · 1 comment
Closed

Make prerender work for non html #10917

rossvold opened this issue Oct 24, 2023 · 1 comment

Comments

@rossvold
Copy link

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:
image

After prerender:
image

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

@Conduitry
Copy link
Member

Essentially a duplicate of #9408.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants