HTML tip – Speed up DNS query by DNS-prefetch


If you HTML pages have many external references e.g. google, then the DNS lookup may slow down the speed. You can easily use link rel=”dns-prefetch” to cache some commonly-used domains, in order to reduce the DNS lookup time. The examples are pretty straightforward. You could just insert them at the beginning of head tag.

<link rel="dns-prefetch" href="//ajax.googleapis.com"/>
<link rel="dns-prefetch" href="//google-analytics.com"/>
<link rel="dns-prefetch" href="//pagead2.googlesyndication.com"/>

That is it! A few lines of code does make a difference. The most important thing is that it does not hurt by adding a few lines of code, and you might notice some difference (although most of time, it is un-noticeable).

dns-and-ipv6 HTML tip - Speed up DNS query by DNS-prefetch dns HTML

dns-and-ipv6

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
195 words
Last Post: Using Imagify WordPress Plugin to Reduce size of Images
Next Post: Software Speccy for Hardware Information

The Permanent URL is: HTML tip – Speed up DNS query by DNS-prefetch

Leave a Reply