Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37385 closed defect (bug) (fixed)

Resource hinting: only dns-prefetch enqueued resources.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.6
Component: Script Loader Keywords: commit
Focuses: Cc:


dns-prefetch link elements are currently created for all registered depenedencies, only create them for enqueued dependencies.

Attachments (1)

37385.diff (3.1 KB) - added by peterwilsoncc 8 years ago.
code: swissspidy, tests: peterwilsoncc

Download all attachments as: .zip

Change History (8)

#1 @swissspidy
8 years ago

Isn't there already a fix for that in another ticket? Can't find it right now though.

8 years ago

code: swissspidy, tests: peterwilsoncc

#2 @peterwilsoncc
8 years ago

@swissspidy there is in #34292 but forking it because it's become a bit of a super ticket.

I've brought the code across in 37385.diff, props due are code: @swissspidy, tests: @peterwilsoncc

#3 @voldemortensen
8 years ago

  • Keywords commit added

#4 @peterwilsoncc
8 years ago

  • Owner set to peterwilsoncc
  • Status changed from new to assigned

#5 @peterwilsoncc
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 38100:

Script Loader: Limit resource hinting to enqueued assets.

Externally hosted script and style dependencies trigger dns-prefetch hinting only when enqueued. This removed a bug in which hinting was added on registration.

Renames the function wp_resource_hints_scripts_styles to wp_dependencies_unique_hosts as the function provides the hosts, not the hinting.

Props swissspidy.
Fixes #37385.

#6 follow-up: @swissspidy
8 years ago

Should the function be called wp_get_dependencies_unique_hosts() as suggested in 50:ticket:34292?

#7 in reply to: ↑ 6 @peterwilsoncc
8 years ago

Replying to swissspidy:

Should the function be called wp_get_dependencies_unique_hosts() as suggested in 50:ticket:34292?

I'm am not sure.

I think of the get_ and the_ prefixes as being somehow different but I can not explain how so succinctly. The prefixes put me in mind of WP objects, usually posts, whereas wp_[get_]dependencies_unique_hosts works at a higher level within WordPress itself.

As I say, I am not sure.

Note: See TracTickets for help on using tickets.