Revalidation — Keeping Cached Data Fresh — Concept Check
Questions on Revalidation — Keeping Cached Data Fresh. Time-based revalidation is a guess about how stale you can afford to be. On-demand revalidation is knowing exactly when something changed — and it is almost always the better answer.
Questions in this quiz
7 questions on Revalidation — Keeping Cached Data Fresh — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A news website uses time-based revalidation with a 3600-second interval for articles. A user visits the site at t=3590 and sees an old version. What happens when another user visits at t=3610?
- AThe old version is served, and regeneration starts.
- BThe site returns an error due to stale content.
- CA fresh version is served immediately.
- DThe page will be dynamically generated on request.
2.A leaderboard is updated every minute. Which caching strategy is most appropriate?
- AUse static caching with no revalidation.
- BNever cache the leaderboard.
- CRevalidate every 3600 seconds.
- DRevalidate every 60 seconds.
3.A developer sets `revalidate = 0` for a price page. What does this imply?
- AThe page is always dynamic, never cached.
- BThe page is revalidated immediately after each request.
- CThe page uses on-demand revalidation.
- DThe page is cached indefinitely without updates.
4.An e-commerce site uses on-demand revalidation for product prices. How does this affect data freshness?
- APrices update every hour automatically.
- BPrices are cached and updated weekly.
- CPrices update instantly upon change.
- DPrices update only when the page is refreshed.
5.A developer uses `revalidateTag('problems')` after updating a problem list. What is the result?
- ANo pages are revalidated, as tags are ignored.
- BOnly the updated problem page is revalidated.
- CAll pages tagged with 'problems' are revalidated.
- DAll cached pages are cleared and rebuilt.
6.A CMS webhook triggers revalidation using a secret key. Why is this important?
- ATo ensure revalidation occurs every minute.
- BTo increase the frequency of cache updates.
- CTo allow public access to revalidation.
- DTo prevent unauthorized revalidation requests.
7.Why is on-demand revalidation preferred when controlling the write path?
- AIt allows indefinite caching without updates.
- BIt precisely updates only changed data.
- CIt reduces server load by caching everything.
- DIt simplifies code by eliminating cache logic.