new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Svelte · SvelteKit · all subjects

prerendering

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Prerendering definition and requirements

Prerendering means computing the contents of a page at build time and saving the HTML for display. For content to be prerenderable, any two users hitting it directly must get the same content from the server, and the page must not contain actions. You can still prerender content that is loaded based on the page's parameters as long as all users will be seeing the same prerendered content. Pre-rendered pages are not limited to static content; you can build personalized pages if user-specific data is fetched and rendered client-side. In SvelteKit, prerendering is controlled with the `prerender` page option and `prerender` config in `svelte.config.js`.

SSG - Static Site Generation definition

Static Site Generation (SSG) is a term that refers to a site where every page is prerendered. One benefit of fully prerendering a site is that you do not need to maintain or pay for servers to perform SSR. Once generated, the site can be served from CDNs, leading to great "time to first byte" performance. This delivery model is often referred to as JAMstack. In SvelteKit, static site generation can be done by using adapter-static or by configuring every page to be prerendered using the `prerender` page option or `prerender` config in `svelte.config.js`.

Prerendering serves multiple purposes beyond caching

Prerendering static pages is not just a poor man's cache-control. It also enables build-time validation, rendering data from the filesystem that edge functions cannot access, and acts as a hedge against flaky databases.

SvelteKit 2.0 improvements for prerendering with optional path segments

SvelteKit 2 includes improved support for prerendering URLs with optional path segments often used to specify a language. This improvement was contributed by the InLang team.

Give your agent this brain