Svelte · Senior · Question 71 of 75
Why might a SvelteKit page with heavy +layout.server.js data hurt navigation speed?
- ✓Correct answer: Layout data that depends on
urlor isn't cached re-runs on many navigations and blocks children; keep layout loads small and independent of volatile inputs - 2Layouts never re-run, so they can't affect speed
- 3Layout data is loaded in the browser
Explanation
Reading url.pathname or url.searchParams in a layout load makes it a dependency, so it re-runs on related navigations.