gijo-varghese / flying-pages

Load inner pages instantly, intelligently
ISC License
213 stars 20 forks source link

Preconnect or DNS Prefetch Cross-Origin Domains #4

Open lrehmann opened 4 years ago

lrehmann commented 4 years ago

It isn't always possible to prefetch cross-origin resources, however, some optimizations can still be made for external links by requesting the browser prefetch the dns records or preconnect to the host. Twitter has enabled such a service while hovering over tweets to external urls. fcc gov-twitter-preconnect

I would like to propose adding a feature to appending dns-prefetch or preconnect html tags when a user hovers or begins to click off-domain url.

<link rel="preconnect" href="https://example.com">
<link rel="dns-prefetch" href="https://example.com">
gijo-varghese commented 4 years ago

@lrehmann this sounds good. Will consider adding it