Skip to content

Protected pre-rendered routes #11700

@hyunbinseo

Description

@hyunbinseo

Describe the problem

I have an expensive static page which also happens to be a protected route.

I would love to prerender the page, but then it is not handled by SvelteKit.

Requests for static assets — which includes pages that were already prerendered — are not handled by SvelteKit.

https://kit.svelte.dev/docs/hooks#server-hooks-handle

Describe the proposed solution

  1. Add another page option in +page|layout.server.ts such as server: true.
  2. Add another value for the current prerender option such as protected.
  3. (Breaking) Convert the page prerender option into an object?
type Prerender = { enabled: boolean; protected: boolean };

https://kit.svelte.dev/docs/page-options#prerender

I am sure there are other usage then protected, but it seemed the most intuitive.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions