liveBook · Manning

Prefetch

As explained in Fast by Default

Prefetching is the technique of loading data or resources before they are explicitly requested, based on an anticipated need.

Prefetching loads data or resources before users explicitly request them, using predicted behavior to reduce waiting on the critical path. Hovering over a link, nearing the bottom of a list, or logging in can trigger work just before the likely next action. section 4.4.3 section 4.0

Use signals to distinguish valuable predictions from wasteful ones: link hover suggests navigation, scroll position suggests pagination, and usage patterns suggest likely features. Prefetch aggressively for high-probability actions and conservatively when uncertainty is high. section 4.4.3

Apply prefetching where the next action is predictable and measurable:

  • Fetch the next page when scrolling approaches the current list boundary. section 4.4.3
  • Warm a search cache when a field receives focus, using popular queries when appropriate. section 4.4.3
  • Run independent requests in parallel and prefetch likely data instead of allowing accidental sequential waterfalls. section 4.6 section 5.6
  • Limit cache depth and retention because deeper prefetch increases bandwidth use, stale data, and memory pressure. section 4.4.3

Layered feed caching

A feed can retain fully decoded images for several visible and adjacent posts in memory, allowing immediate scrolling until resource limits are reached. Engagement-weighted retention keeps lingered-on posts longer than quickly skipped posts, trading memory and freshness against perceived responsiveness. section 4.4.3

Figure 4.1 Critical path and deferred work. The critical path blocks the user while deferred work happens afterward without affecting what they experience.

Use the critical-path diagram to separate prefetch work that removes future waiting from deferred work that can safely happen afterward. section 4.0

How Fast by Default covers it

How deep it goes
Explains triggers, cache trade-offs, prediction signals, and parallel fetching, but stops short of implementation code.
Examples
Uses link hover, list scrolling, login, focused search fields, and layered feed-image caches as examples.
What it assumes
Assumes familiarity with user interactions, network requests, caching, and critical paths while explaining prediction from basic signals.
What you can do after
Apply it by identifying high-probability actions, preloading their data, and limiting waste from incorrect predictions.
How it connects
Connects critical paths, caching, lazy loading, parallel requests, batching, and asynchronous processing.

Also explained in

Compare how 4 books explain prefetch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.