Recall & Review
beginner
What is static data fetching in Astro?
Static data fetching means getting data at build time. The data is fetched once when the site is built, then saved as static files. This makes pages load very fast because no server work is needed when users visit.
Click to reveal answer
beginner
What does server-side data fetching mean in Astro?
Server-side data fetching means getting data when a user requests a page. The server fetches fresh data each time, then sends the page. This is good for data that changes often.
Click to reveal answer
beginner
Name one advantage of static data fetching.
Pages load very fast because data is already included in the built files. No waiting for server responses on each visit.
Click to reveal answer
beginner
Why might you choose server-side data fetching over static?
If your data changes often or depends on the user, server-side fetching gives fresh data every time the page loads.
Click to reveal answer
intermediate
How does Astro let you choose between static and server-side data fetching?Astro uses special functions like
getStaticPaths for static and server-only code for server-side fetching. You pick based on your data needs.Click to reveal answer
When is static data fetched in Astro?
✗ Incorrect
Static data fetching happens once during the build process, so data is ready before users visit.
Which data fetching method gives the freshest data on each page load?
✗ Incorrect
Server-side fetching gets data when the page is requested, so it is always up to date.
What is a downside of server-side data fetching?
✗ Incorrect
Fetching data on every request adds delay before the page shows.
Which Astro function is used for static data fetching?
✗ Incorrect
getStaticPaths helps fetch data at build time for static pages.If your site data rarely changes, which fetching method is best?
✗ Incorrect
Static fetching is best for rarely changing data because it makes pages fast and simple.
Explain the difference between static and server-side data fetching in Astro.
Think about when the data is fetched and how it affects page speed and freshness.
You got /4 concepts.
When would you choose server-side data fetching over static in a real website?
Consider websites like news or user dashboards.
You got /4 concepts.