Skip to content

Instantly share code, notes, and snippets.

@rsiddle
Created September 19, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsiddle/2826590b0a07f9aede89bee148686c07 to your computer and use it in GitHub Desktop.
Save rsiddle/2826590b0a07f9aede89bee148686c07 to your computer and use it in GitHub Desktop.
Showing how to switch on and off DNS-prefetch for Chrome and Firefox through multiple <meta> tags
<!DOCTYPE html>
<html lang="en">
<head>
...
<meta http-equiv="X-DNS-Prefetch-Control" content="on" />
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://ajax.googleapis.com" />
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com" />
<link rel="dns-prefetch" href="https://www.google-analytics.com" />
...
</head>
<body>
...
<article>
<p>Make sure you check out the <a href="https://dev.chromium.org/developers/design-documents/dns-prefetching">Chromium project</a>!</p>
</article>
<div class="comments-box">
<meta http-equiv="X-DNS-Prefetch-Control" content="off" />
<div class="comment">
<span class="author">Joe Blogs</span>
<p>Hey, check out <a href="https://example.com">Example</a>, it’s a domain holder.</p>
</div>
<div class="comment">
<span class="author">John Smith</span>
<p>What about <a href="https://placeholder.it">Placeholders</a>, for HTML design?</p>
</div>
<meta http-equiv="X-DNS-Prefetch-Control" content="on" />
</div>
<footer>
<a href="https://merj.com">MERJ Parent Company</a> &copy; 2017
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment