primate
primate copied to clipboard
prerendering routes
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.sessionin a route should throw aCannotPrerenderError, 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 theGETroute, 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