[wp-trac] [WordPress Trac] #34292: Support for DNS Prefetching & Prerender
WordPress Trac
noreply at wordpress.org
Sun Jul 10 09:57:18 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):
Replying to [comment:47 superpoincare]:
> I am not sure if you want to DNS prefetch for all scripts and styles
enqueued.
>
> This is because if the script is in the head, the browser automatically
connects to the server. So adding a prefetch might make the browser
connect twice.
From the specification:
> For example, the application may provide the following resource hints to
the user agent:
> * The list of origins from which resources will be fetched.
> * The next likely user action or navigation target, and the resources
that will be required, based on current page or application state,
individual user history, or aggregated session data.
So yeah, it makes more sense to add resource hints for enqueued assets
instead of registered ones. Especially since the browser only does the DNS
prefetching for these, so the actual retrieval will be faster.
Developers can then build upon this to add resource hints for the next
likely user targets (e.g. the most recent post when on the homepage etc.).
We didn't include this on purpose.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34292#comment:48>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list