WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 16 months ago

#37388 new enhancement

Resource hinting: only dns-prefetch resources in HTML footer.

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

Description

In #34292 @superpoincare raised some concerns about hinting items in the HTML header, arguing it was of use to hint items in the footer only as the browser will connect to resources enqueued in the HTML header quickly regardless.

@swissspidy pointed out "Even when enqueued in the head of the document, the resource hints will be delivered to the browser much earlier because their higher up in the source and therefore likely in another HTTP packet. Already being able to perform all necessary handshakes only benefits the actual retrieval of the assets later on."

@peterwilsoncc thought there was some validitaty to skipping hinting on items in the HTML header but it's something that can be decided later. Oh, that's me.

Related #37387

Milestoning for discussion.

Change History (3)

#1 follow-up: @voldemortensen
4 years ago

I don't think I'm concerned about the potential for a double lookup. If in the event a second lookup just happens be triggered, it will already be cached locally from the first lookup and add maybe 1ms. And this is assuming that browsers actually let the second lookup happen.

#2 in reply to: ↑ 1 @peterwilsoncc
4 years ago

  • Milestone changed from 4.6 to Future Release

Replying to voldemortensen:

If in the event a second lookup just happens be triggered, it will already be cached locally from the first lookup and add maybe 1ms.

I agree, browsers are on top of several requests from single servers. It's something they handle with assets multiple times per page view with images, font files, etc.

Moving to future release.

#3 @ocean90
4 years ago

  • Component changed from General to Script Loader
  • Type changed from defect (bug) to enhancement
Note: See TracTickets for help on using tickets.