Fast links

5:34 film

After this film you canmake links fast with prefetching and Partial Prefetching.

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. When does a <Link> fetch the next page?

    Before the click: when it scrolls into view, and on hover if what it holds has expired. Only in a production build.

  2. Carol's list has 24 links to lamp pages. Why does it fetch the lamp page only once?

    They all lead to one route, /lamps/[id], and Partial Prefetching fetches that route's App Shell once and shares it.

  3. Why does the lamp's name stream in after the tap, while "← All lamps" is there at once?

    The name reads params, which differs per link, so it sits inside Suspense, outside the shared App Shell.

Docs this film covers