Caching at the Edge in Production — Concept Check
Questions on Caching at the Edge in Production. Beyond the framework's caches sits the CDN, and beyond that the browser. A cache key that ignores the user is the most damaging bug in this whole track.
Questions in this quiz
7 questions on Caching at the Edge in Production — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer notices that their personalized dashboard page is being served to other users. What is the most likely cause?
- AThe page is set to no-store, preventing caching.
- BThe browser is caching the page for too long due to high max-age.
- CThe CDN is caching the page by URL without user-specific keys.
- DThe static assets are not hashed.
2.After deploying a new version of a site, users still see the old page. What is a likely reason?
- AThe browser cache holds the old page due to a long max-age.
- BThe static assets were not updated.
- CThe CDN cache was not purged, so it still serves the old page.
- DNext's internal cache was not invalidated during deployment.
3.A route handler returns user-specific data without setting any cache headers. What is the risk?
- AThe page might be cached in the CDN and served to other users.
- BThe browser will cache the page indefinitely.
- CThe static assets will be cached incorrectly.
- DThe page will not be cached at all, causing performance issues.
4.Which Cache-Control header setting is appropriate for a page that should never be cached?
- ACache-Control: private, max-age=60
- BCache-Control: s-maxage=3600, max-age=0
- CCache-Control: no-store
- DCache-Control: public, max-age=60
5.A developer sets 'Cache-Control: private, max-age=60' for a user-specific API response. What does this achieve?
- AIt caches the response in the browser only, not shared caches.
- BIt allows the CDN to cache the response for 60 seconds.
- CIt prevents any caching of the response.
- DIt caches the response in both the browser and CDN.
6.A static asset is being cached for a year. What Cache-Control setting is likely used?
- ACache-Control: private, max-age=60
- BCache-Control: no-store
- CCache-Control: immutable, max-age=31536000
- DCache-Control: public, s-maxage=3600
7.Why is it important to avoid caching personalized fragments in prerendered pages?
- AIt leads to longer load times for static assets.
- BIt causes performance issues due to excessive caching.
- CIt prevents the CDN from caching the page efficiently.
- DIt can lead to data breaches by serving incorrect user data.