dns-prefetch. Anyone familiar?
|
04-12-2012, 03:47 AM
(This post was last modified: 04-12-2012 04:17 AM by p83822.)
Post: #7
|
|||
|
|||
RE: dns-prefetch. Anyone familiar?
My expectation was that the look ahead preparser would recognise nodejs.org and http://www.w3.org as being in the html, but would not recognise http://www.w3schools.com as it is in the JS. My understanding being that look ahead preparsers do not read JS. To my surprise, the DNS lookup for http://www.w3.org occurs after the sleep. (VRTA graphs this beautifully - see attached.) Pic1 is with dns-prefetch tags commented out, Pic2 with them in. The horrid code?. Enjoy: <html> <head> <meta charset="utf-8"> <!--<link rel="dns-prefetch" href="//nodejs.org"> <link rel="dns-prefetch" href="//www.w3.org"> <link rel="dns-prefetch" href="//www.w3schools.com">--> </head> <body> <img src='http://nodejs.org/images/logo.png'/> <script type=""> (function() { var startTime = new Date().getTime(); while (new Date().getTime() < startTime + 1000); }()) </script> <img src='http://www.w3.org/2008/site/images/twitter-bird'/> <script type="text/javascript"> (function() { var d = function() { var img = document.createElement("img"); img.src = "http://www.w3schools.com/images/w3schoolslogo.gif"; var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(img, s0); }; setTimeout(d, 1000); }()) </script> </body> </html> Daftness. Nothing will happen during the sleep. D'oh! Nice to know that the prefetch directive now though. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
dns-prefetch. Anyone familiar? - p83822 - 02-15-2010, 08:25 PM
RE: dns-prefetch. Anyone familiar? - p83822 - 02-18-2010, 06:11 AM
RE: dns-prefetch. Anyone familiar? - pmeenan - 02-18-2010, 10:45 AM
RE: dns-prefetch. Anyone familiar? - p83822 - 02-22-2010, 05:58 AM
RE: dns-prefetch. Anyone familiar? - hsiboy - 02-25-2010, 08:00 AM
RE: dns-prefetch. Anyone familiar? - pmeenan - 02-25-2010, 10:19 AM
RE: dns-prefetch. Anyone familiar? - p83822 - 04-12-2012 03:47 AM
RE: dns-prefetch. Anyone familiar? - p83822 - 04-12-2012, 07:01 PM
RE: dns-prefetch. Anyone familiar? - pqdbr - 04-17-2012, 02:59 PM
|
User(s) browsing this thread: 1 Guest(s)