Hello,
The plugin is technically working, but is placing the prefetch tag below the meta charset
, meta name
, and title
tags, as well as the profile
and pingback
links.
(Ideally) DNS prefetch tags should be placed just above the meta charset
tag. Is there an easy way to accomplish this with this plugin?
Thanks,
AJ
In addition to Firefox 3.5+, don’t Chrome 5+ and IE10+ support the <link href="//my.domain.com" rel="dns-prefetch" />
tag?
I’m just curious as to why the plugin is described as a Firefox only, DNS prefetch solution.
Best,
AJ
Great plugin, being able to call it from themes or other plugins would be really useful.
You can add a filter just before you print the HTML, in dns-prefetch.php line 126.
Before:
$tta = explode("\n", $options[DPF_DEFAULT_TEXT_NAME]);
After:
$tta = explode("\n", $options[DPF_DEFAULT_TEXT_NAME]);
$tta = apply_filters('dpf_domains', $tta);
Now we can add our own prefetch domains via:
add_filter('dpf_domains', function($tta)
{
$tta[] = '//another-domain.com';
return $tta;
});
Cheers!
]]>This is a great plugin and highly useful for sites.
One thing that would be great is if you loaded the domains to be prefetched before any scripts are loaded from them. Add a priority number for the hook you use into wp_head.
On line 120 of the dns-prefetch.php file, change
add_action('wp_head', 'dpf_prefetch');
to
add_action('wp_head', 'dpf_prefetch',0);
This way the DNS is prefetched as one of the first things loaded when calling wp_head.
Thanks.
]]>