Or cache it

5:41 film

After this film you cancache a slow read with 'use cache' and cacheLife.

Exercise

Download the exercise (a zip). Unzip it, read exercise.md, then in exercise/ run npm install and node check.mjs. The checker runs a real build and says PASS or FAIL for each criterion.

Recall

Answer each one out loud before you open it.

  1. Why did the price stop needing a fallback?

    The cached function ran during the build, so the price is in the static shell.

  2. The copy is past revalidate. Does the next visitor wait?

    No: they get the cached copy at once, and their visit starts a background refresh.

  3. What makes a visitor wait?

    Arriving after expire, when nobody has visited since the copy was made.

Docs this film covers