Overview - Why data fetching happens at build time
What is it?
Data fetching at build time means getting all the information your website needs before it is shown to visitors. Instead of asking for data when someone visits, the site collects it once while building. This makes the website faster and more reliable because the data is already there. It is common in static site generators like Astro.
Why it matters
Without fetching data at build time, websites would need to get data every time someone visits, which can slow things down and cause delays or errors if the data source is slow or unavailable. Fetching data early means visitors get a fast, smooth experience and the site can work even if the data source is offline later.
Where it fits
Before learning this, you should understand basic web development and how websites load content. After this, you can learn about client-side data fetching, server-side rendering, and incremental static regeneration to see different ways data can be loaded.