[wp-trac] [WordPress Trac] #34292: Support for DNS Prefetching & Prerender
WordPress Trac
noreply at wordpress.org
Sun Jul 10 10:00:54 UTC 2016
#34292: Support for DNS Prefetching & Prerender
-------------------------------------------------+-------------------------
Reporter: bhubbard | Owner:
Type: feature request | voldemortensen
Priority: normal | Status: closed
Component: Script Loader | Milestone: 4.6
Severity: normal | Version:
Keywords: has-patch has-unit-tests needs-dev- | Resolution: fixed
note needs-docs | Focuses:
| performance
-------------------------------------------------+-------------------------
Comment (by swissspidy):
@GaryJ Thanks for pointing out! That function really can be optimized.
In [attachment:34292.10.diff]:
* Rename `wp_resource_hints_scripts_styles()` to
`wp_dependencies_unique_hosts()` (other suggestions welcome)
* Only returns unique hosts for ''enqueued'' dependencies. Otherwise you
get unneeded entries for fonts.googleapis.com and stuff like that
* Fixes docs
* Removes duplicated code by looping over `$wp_scripts` and `$wp_styles`
as they both extend the `WP_Dependencies` class
Worth noting: The unit tests still pass with this patch applied. They
shouldn't, i.e. we need a new test.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34292#comment:49>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list