After a save

5:52 film

After this film you canshow the save immediately with updateTag.

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. Carol saves a new price, and the page still shows the old one. Why?

    The page reads the cached function's copy, and a save doesn't change the copy until it expires or its cache life runs out.

  2. What two lines make the save show at once?

    cacheTag('price') in the cached function, and updateTag('price') in the Server Function that saves.

  3. Why must updateTag come before redirect?

    redirect throws, so nothing after it runs: the copy is never expired, and nothing warns you.

Docs this film covers