Hey folks! Just wanted to let everyone know about this cool new library from GoogleChromeLabs called quicklink.
It attempts to make navigations to subsequent pages load faster. It:
- Detects links within the viewport (using Intersection Observer )
- Waits until the browser is idle (using requestIdleCallback )
- Checks if the user isn't on a slow connection (using navigator.connection.effectiveType) or has data-saver enabled (using navigator.connection.saveData)
- Prefetches URLs to the links (using
<link rel=prefetch> or XHR
). Provides some control over the request priority (can switch to fetch() if supported).
I just added this to Hashnode feed so that top 5 posts are always preloaded in the browser idle time. I must admit it has significantly improved the subsequent ajax calls (for loading posts). Just trying this with top 5 posts. If it works out well, we'll preload other ajax calls as well.
Here is a small video depicting this:
Thoughts? Let me know in comments below. 😀