quicklink is a prefetching library that speeds up subsequent page loads by automatically prefetching or prerendering in-viewport links during idle browser time.
The library works by detecting links visible in the viewport using the Intersection Observer API, waiting for the browser to become idle via requestIdleCallback, and checking connection quality before prefetching or prerendering those URLs. It respects slow connections and data-saver preferences by skipping prefetching when either is detected. The tool supports multiple prefetching strategies including link rel=prefetch, XHR requests, and the Speculation Rules API for prerendering, with configurable request priority that can fall back to fetch() when supported.
Quicklink suits any site seeking a lightweight, drop-in prefetching solution without complex configuration. It works with both multi-page applications via direct initialization and single-page applications like React through a higher-order component wrapper. The library is designed to be minimal, shipping at under 2KB minified and gzipped, with a modern ES module build available for browsers with native module support. The tool provides a reset function for clearing cached URLs and observers between page navigations or after significant DOM changes, making it suitable for dynamic applications.
Development activity shows consistent maintenance with passing continuous integration checks. The project maintains multiple build outputs to serve different browser support requirements. Documentation covers both traditional multi-page app integration and modern single-page app patterns with concrete examples. The codebase includes configuration options for controlling prefetch behavior, such as toggling between prefetch and prerender modes.