i wanted to test whether my browser honors resource hints, namely dns-prefetch, preconnect, etc.
i created a simple html file, name index.html
as follows
<!doctype html>
<html>
<head>
<link rel="dns-prefetch" href="//www.wikipedia.org">
</head>
<body>
</html>
and i started nginx locally to serve index.html
as follow
docker run --rm -it -p 80:80 -v $PWD:/usr/share/nginx/html nginx:latest
i launched chromium (Version 88.0.4283.0 (Developer Build) (x86_64)), and moved to browse as guest user (to guarantee a new browser session).
i started netlog dump (started the netlog dump), in a new tab i navigated to localhost
and index.html
was served, and then i stopped the dump.
i opened the netlog dump in netlog-viewer and navigated to the DNS tab, but there was no record for www.wikipedia.org
.
- what is missing in order to see that the
dns-prefetch
resource hint worked as expected? - same question as the previous with respect to
preconnect
i looked at this answer, but it didn't help me. also tried to append crossorigin
to the <link>
tag, but still didn't change anything.
UPDATE:
to further debug the issue, i added <link rel="preconnect" href="//localhost:8080">
, started another local http server on a different port, which logs when connection is established, and repeat the steps mentioned before. yet, there was no logs indicating on the preconnect
.