The reason is that the library look-up for in-viewport elements is restricted to those of the top-level origin. In these cases, those ad-links won't be prefetched by Quicklink, unless a developer explicitly passes in the URL of an ads iframe. Inside iframes: By default, most ad-servers render ads within iframes. Sites that rely on ads as a source of monetization should not prefetch ad-links, to avoid unintentionally counting clicks against those ad placements, which can lead to inflated Ad CTR (click-through-rate). To workaround this problem, you can consider passing along session information via the ping attribute (separately) so the origin can stitch a session together asynchronously. This introduces a challenge as it can result in double prefetches. If session-stitching requires a timestamp in the URL, what is prefetched and stored in the HTTP cache may not be the same as the one the user ultimately navigates to. b.com may expect a.com's navigation requests to include session information (e.g a temporary ID - e.g b.com/bar.html?hash=×tamp=), where this information is used to customize the experience or log information to analytics. One such limitation is with session-stitching. Additional notes Session StitchingĬross-origin prefetching (e.g a.com/foo.html prefetches b.com/bar.html) has a number of limitations. Just a demo of the potential improvements the approach can offer. Please note: this is by no means an exhaustive benchmark of the pros and cons of in-viewport link prefetching. We then deployed another version of it, adding quicklink to the homepage and benchmarked navigating from the homepage to an article that wasĪutomatically prefetched. A video comparison of the before/after prefetching is on YouTube.įor demo purposes, we deployed a version of the Google Blog onįirebase hosting. Here's a WebPageTest run for our demo improving page-load performance by up to 4 seconds via quicklink's prefetching. Using Quicklink to prerender a specific page.Using Quicklink to prefetch API calls instead of href attribute.Using Quicklink with Service Workers (via Workbox).