Recall & Review
beginner
What is caching in the context of API responses?
Caching means saving a copy of the API response so the app can use it again without asking the server. This makes the app faster and reduces server work.
Click to reveal answer
beginner
Why should you cache API responses in Astro projects?
Caching API responses in Astro helps pages load faster and lowers the number of requests to the server, improving user experience and saving resources.
Click to reveal answer
intermediate
Which Astro feature helps with caching API responses during build time?
Astro's server-side rendering and static site generation let you fetch and cache API data at build time, so pages serve pre-fetched data quickly.Click to reveal answer
intermediate
What is stale-while-revalidate in caching?
Stale-while-revalidate means showing cached data immediately while fetching fresh data in the background to update the cache for next time.
Click to reveal answer
intermediate
How can you control cache duration for API responses in Astro?
You can set cache headers or use Astro's fetch options to specify how long the cached API response stays valid before fetching new data.
Click to reveal answer
What is the main benefit of caching API responses in Astro?
✗ Incorrect
Caching saves API data so pages load faster and the server handles fewer requests.
When does Astro typically fetch and cache API data for static pages?
✗ Incorrect
Astro fetches API data during build time to generate static pages with cached data.
What does stale-while-revalidate caching do?
✗ Incorrect
It serves cached data fast and refreshes the cache quietly for next use.
How can you set how long an API response stays cached in Astro?
✗ Incorrect
Cache duration is controlled with cache headers or fetch settings.
Which of these is NOT a benefit of caching API responses?
✗ Incorrect
Caching reduces network traffic, it does not increase it.
Explain how caching API responses improves performance in Astro projects.
Think about how saving data ahead helps avoid waiting for the server.
You got /4 concepts.
Describe the stale-while-revalidate caching strategy and why it is useful.
It's like showing an old photo quickly while taking a new one quietly.
You got /4 concepts.