Group
  • Performance

    Warm up connections and next-page loads with prefetch hints

    Use preconnect, dns-prefetch, and prefetch to hide latency you can't remove.

    • Improve quality
    • Ship faster
    • Intermediate
    • General

Free Prompt

My app makes requests to third-party origins (fonts, APIs, CDNs, payment providers) and navigates between pages in predictable ways. I want to use resource hints to shave off latency, without shotgun-spraying hints everywhere. Audit and implement resource hints: 1. Map my critical third-party origins: which origins does the page need early (font hosts, my API domain, my CDN)? For each, add preconnect for the ones needed immediately at load. Use dns-prefetch only as a fallback for older browsers or lower-priority origins. 2. Check my crossorigin usage: preconnect to font origins must include the crossorigin attribute or the connection is wasted and opened twice. 3. Identify predictable navigations: the landing page's primary CTA destination (signup flow), the login page's post-auth dashboard. Consider prefetching those next-page resources during idle time so the click feels instant. 4. Consider prerendering only for extremely high-confidence navigations, and note the analytics and consent implications before enabling it. 5. Set a budget: hints have costs (connections, bandwidth, battery). Limit preconnects to the few origins that matter and prefetch to one or two high-probability destinations. Don't preconnect to every origin the page touches; idle connections cost the user and the third party. Don't prefetch pages with side effects (logout links, one-time actions) or personalized pages where a wrong guess wastes real data. The deliverable is the implemented hints with the reasoning per origin/destination, and how to verify: connection timing in dev tools before and after.

What This Does / How This Helps

This maps your critical origins and predictable navigations, then adds preconnect and prefetch hints with a strict budget so they help instead of adding noise. Connection setup (DNS, TLS) to a third-party origin can cost hundreds of milliseconds on mobile, and it happens serially when the browser discovers the origin late. Preconnecting to the two or three origins that matter removes that from the critical path. The trap is overdoing it: pages with a dozen preconnects and prefetches for every link spend the user's bandwidth and battery on guesses. This applies the hints where the payoff is real and skips the rest.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts