Working Ahead of Need
Latency hurts most when work starts only at the moment of need. Prefetch and preconnect are hints that let the client start network work early so a future resource is ready or faster to fetch.
The Family of Hints
These hints differ in how much they do ahead of time.
- Preconnect opens the connection early, paying the handshake before the resource is requested.
- Prefetch fetches a resource the next page is likely to need and stores it in the cache.
- Preload fetches a resource the current page needs soon, raising its priority.
Each one moves a cost earlier so the user does not wait for it later.
The Cost of Guessing
These hints are speculative. If the prediction is wrong, the client spends bandwidth and connections on resources it never uses. On metered or busy links that waste can hurt, so hints should target high confidence predictions rather than everything.
Key idea
Prefetch and preconnect move network work earlier so future resources are ready or faster, but because they are speculative they should target high confidence predictions to avoid wasting bandwidth.