Skip to content

QuizNot attempted

Real-time data

Stock level on a product page must always be live. Which fetch option?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • cache: 'no-store'
  • cache: 'no-store' opts the request out of the Data Cache and makes the route render per request, so every view sees current stock.
  • Not revalidate: 300: up to five minutes stale.
  • Not tags: tags enable on-demand invalidation of a cached value
  • it is still cached until something invalidates it.
  • Not 'never cached': Next 15 doesn't cache fetch by default, but on an otherwise static route the result is baked in at build time, so be explicit.
  • For per-second updates, poll on the client (SWR/TanStack Query).