Use dns-prefetch to improve performance
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="dns-prefetch" href="//www.google-analytics.com">
DNS-prefetch is an attempt to resolve domain names before resources get requested.
When a browser requests a resource from a (third party) server, that cross-origin’s domain name must be resolved to an IP address before the browser can issue the request. This process is known as DNS resolution. While DNS caching can help to reduce this latency, DNS resolution can add significant latency to requests. For websites that open connections to many third parties, this latency can significantly reduce loading performance.
dns-prefetch
helps developers mask DNS resolution latency. The HTML <link>
element offers this functionality by way of a rel
attribute value of dns-prefetch
.