[wp-trac] [WordPress Trac] #34292: Support for DNS Prefetching & Prerender
WordPress Trac
noreply at wordpress.org
Mon Jun 27 07:48:44 UTC 2016
#34292: Support for DNS Prefetching & Prerender
--------------------------------------+-----------------------------
Reporter: bhubbard | Owner: voldemortensen
Type: feature request | Status: assigned
Priority: normal | Milestone: 4.6
Component: Script Loader | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+-----------------------------
Comment (by swissspidy):
[attachment:34292.6.diff] is an alternative patch with a more simplified
approach.
* Changes the naming of the function to `wp_resource_hints()`, as
`wp_browser_hints()` to me sounds like a browsehappy.com browser nag.
Resource hints is more accurate.
* Moves the admin parts into that function as it's only a few lines of
code and not much added complexity.
* Simplifies the logic to get rid of `unique_browser_hints()` and
`add_prefetch_attr()`
* Improves unit tests to test the admin parts as well. Moves the various
`$preexpected` assertions to a separate test.
* Adds one single `wp_resource_hints` filter.
To do:
* Add test for scripts and styles enqueuing.
* Add assertion for the `parse_url()` part for `dns-prefetch`
* Decide whether the filter makes sense inside the `foreach` loop or if it
should be outside.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34292#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list