primate icon indicating copy to clipboard operation
primate copied to clipboard

prerendering routes

Open terrablue opened this issue 1 year ago • 0 comments

Use cases: static websites, partially static websites.

Possible approaches:

  • some (or all) routes are SSR'd at startup into static files, using some pseudo-request object, because they only contain static information
  • blockers: using request.session in a route should throw a CannotPrerenderError, because sessions are unique to users; same for using request.store
  • we could prerender an entire application, add a export const prerender = true; to a route file (would apply only to the GET route, in such a case the route file may not contain other HTTP verbs), and/or automatically prerender all routes which look like filenames: for example, routes/sitemap.xml.js

terrablue avatar Jun 08 '24 12:06 terrablue