[wp-trac] [WordPress Trac] #42438: Add support for preload links (similar to resource hints)

WordPress Trac noreply at wordpress.org
Wed Jul 13 15:20:30 UTC 2022


#42438: Add support for preload links (similar to resource hints)
----------------------------+-------------------------
 Reporter:  nico23          |       Owner:  swissspidy
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  6.1
Component:  Script Loader   |     Version:  4.9
 Severity:  normal          |  Resolution:
 Keywords:  has-unit-tests  |     Focuses:
----------------------------+-------------------------

Comment (by mihai2u):

 From my experience with hints - they get enqueued with a low priority, and
 encountering a preload bumps up the priority (like from low to medium).
 This does not have a performance penalty.

 Preloads should be output first, as the main use-case for them is if they
 are present in the initial HTML response, to trigger their download before
 the HTML is fully downloaded & parsed.

 If we configure the defaults for preloads to show up earlier than hints,
 the presence of a hint later would yield no difference, or any switch in
 the prioritisation level of the request.

 My tests with hints / preloads & preloads with or without the
 fetchpriority attribute set to high were done back in May, so quite recent
 to still hold relevancy now.

 My opinion is adding extra logic to remove duplication of resources to not
 show up under a preload and a hint at the same time is not one guardrail
 we'd like to impose. The web changes quickly enough not to consider
 forever recommended to do things in X way over another. Having both
 options to the engineers to use is better.

 I myself would consider filling a ticket if I do a resource preload and a
 resource hint and the hint isn't showing, and could waste some precious
 minutes trying to figure out why isn't the function behaving like I would
 expect.

 @azaozz if you need specific examples to confirm my own prior conclusions
 laid above I can create some HTML docs accordingly to back them up. Ask
 and I'll support.
 This is a key feature I've been using often after the HTTP push got its
 browser support revoked, and it should be part of the WP toolset.

 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42438#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list