DNS Prefetching for Tracking Applications
-
Can somebody help explain to me how using DNS Prefetching would help performance of a site when only used for tracking applications. Not quite sure how to word this but lets say I see the following on every page of a website:
rel="dns-prefetch" href="avgtechnologiescyltd.tt.omtrdc.net"/>
rel="dns-prefetch" href="dis.ny.us.criteo.com"/>
rel="dns-prefetch" href="googleads.g.doubleclick.net"/>
What and how does this create a performance advantage? And is it correct to assume that with a performance advantage you could expect this to impact SEO efforts?
Thanks!
-
Hi Chris. Here's the Google Dev page on it: https://developers.google.com/speed/pagespeed/service/PreResolveDns
With the speed enhancement being, "DNS resolution time varies from <1ms for locally cached results, to hundreds of milliseconds due to the cascading nature of DNS. This can contribute significantly towards total page load time. This filter reduces DNS lookup time by providing hints to the browser at the beginning of the HTML, which allows the browser to pre-resolve DNS for resources on the page."
It's similar to preloading images that are going to appear on the next page clicked or scrolled to. The transition seems much faster when it's loaded while interacting with the first page. Cheers!
-
Yeah, I guess I get this for on-page stuff but for 3rd party tracking I wouldn't think this would make that big of a difference. Maybe that assumption is wrong but how much of a performance impact are you going to get do you think? Is it really worth considering this?
-
It's just another thing that can be ticked off the list. Even with third party tracking it could vary substantially depending on where the original request is coming from. Even if the time savings are miniscule moving up in Pagespeed grade is useful.
-
Hey Chris, one of the bigger two factors on page load speed are the number of http requests (meaning various files that have to be loaded, but each new domain slows things down even further). Essentially, every time they see a new subdomain or domain the browser has to go lookup DNS information for that URL.
Because of that, prefetching DNS info for those 3rd party sites is valuable since it tells the browser "here is the full list of domains you need to get info on" right upfront.
As Ryan mentioned, it's just one more thing that can get checked off the list. I think the value of implementing this is going to be strongest for high-traffic publishers which have tons of 3rd party data collection on their site from ad networks and other providers.