Search code examples
dnsprefetch

DNS Prefetch subdomains


I have a question regarding dns prefetch of internal subdomains. Say i have a site spread ower several subdomains:

  • www.domain.com
  • images.domain.com
  • shop.domain.com

Will it give me any perfomance to do a prefetch of those subdomains? Like this:

 <link href="//images.domain.com" rel="dns-prefetch" />
 <link href="//shop.domain.com" rel="dns-prefetch" />

Solution

  • If you've determined that it would be useful to use dns-prefetch for some resources, there is no difference between a subdomain vs a completely independent domain in that case so I would use prefetch.

    Each subdomain can contain completely different addresses, cnames, etc so from the perspective of the browser they are as different as any other domain.