Created
July 15, 2015 21:47
-
-
Save BurlesonBrad/f7f8c251642e711e7b88 to your computer and use it in GitHub Desktop.
DNS Prefetching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Let's see if I can do dns prefetching correctly | |
*/ | |
add_action('wp_head', 'dns_prefetch'); | |
function dns_prefetch() { | |
echo '<link rel="dns-prefetch" href="//fonts.gstatic.com" />'; | |
echo '<link rel="dns-prefetch" href="//google-analytics.com" />'; | |
echo '<link rel="dns-prefetch" href="//google.com" />'; | |
echo '<link rel="dns-prefetch" href="//stats.g.doubleclick.net" />'; | |
echo '<link rel="dns-prefetch" href="//gmpg.org/xfn/11" />'; | |
echo '<link rel="dns-prefetch" href="//fonts.googleapis.com" />'; | |
echo '<link rel="dns-prefetch" href="//twitter.com" />'; | |
echo '<link rel="dns-prefetch" href="//facebook.com" />'; | |
echo '<link rel="dns-prefetch" href="//plus.google.com" />'; | |
echo '<link rel="dns-prefetch" href="//linkedin.com" />'; | |
echo '<link rel="dns-prefetch" href="//pinterest.com" />'; | |
echo '<link rel="dns-prefetch" href="//twitter.com" />'; | |
} | |
//Slap my fanny and call me Bertha. It worked! // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment