Problem
The client router's default link prefetch uses the intent strategy: it warms the next page on hover / focus / touchstart (router-client.js). On mobile this gives little to no benefit: there is no hover, and touchstart fires essentially at tap time, so the prefetch races the navigation instead of front-running it. The fast-by-default promise effectively does not hold on touch devices.
Design / approach
Research and ship a prefetch strategy that actually helps on mobile, without regressing desktop or over-fetching on metered connections:
- Viewport / visible prefetch (Quicklink / SvelteKit
hover-plus-viewport model): prefetch links as they enter the viewport, throttled and gated on navigator.connection (skip on save-data / 2g), the most reliable mobile signal.
- Consider making the DEFAULT strategy mobile-aware (viewport on touch / no-hover, intent on pointer devices) rather than a single
intent default, keeping the per-link data-prefetch override.
- Respect
prefers-reduced-data / save-data, a concurrency cap, and the existing prefetch cache + mutation eviction.
- Keep it build-free and progressive-enhancement-safe (no behavior change with JS off).
Prior art: Quicklink, Next.js <Link prefetch>, SvelteKit data-sveltekit-preload-data="viewport", Astro prefetch viewport.
Acceptance criteria
Problem
The client router's default link prefetch uses the
intentstrategy: it warms the next page on hover / focus /touchstart(router-client.js). On mobile this gives little to no benefit: there is no hover, andtouchstartfires essentially at tap time, so the prefetch races the navigation instead of front-running it. The fast-by-default promise effectively does not hold on touch devices.Design / approach
Research and ship a prefetch strategy that actually helps on mobile, without regressing desktop or over-fetching on metered connections:
hover-plus-viewportmodel): prefetch links as they enter the viewport, throttled and gated onnavigator.connection(skip onsave-data/2g), the most reliable mobile signal.intentdefault, keeping the per-linkdata-prefetchoverride.prefers-reduced-data/save-data, a concurrency cap, and the existing prefetch cache + mutation eviction.Prior art: Quicklink, Next.js
<Link prefetch>, SvelteKitdata-sveltekit-preload-data="viewport", Astro prefetchviewport.Acceptance criteria
touchstart.data-prefetchper-link overrides still work.agent-docs/advanced.mdclient-router prefetch section) updated.