[wp-trac] [WordPress Trac] #61734: Add the ability to handle "fetchpriority" to ES Modules and Import Maps

WordPress Trac noreply at wordpress.org
Tue Aug 6 02:23:44 UTC 2024


#61734: Add the ability to handle "fetchpriority" to ES Modules and Import Maps
---------------------------+--------------------------------------
 Reporter:  dennysdionigi  |       Owner:  westonruter
     Type:  enhancement    |      Status:  accepted
 Priority:  normal         |   Milestone:  6.7
Component:  Script Loader  |     Version:  6.5
 Severity:  minor          |  Resolution:
 Keywords:  needs-patch    |     Focuses:  javascript, performance
---------------------------+--------------------------------------

Comment (by dennysdionigi):

 Replying to [comment:4 westonruter]:
 > I'm having a hard time reproducing the results I saw above. Now I'm
 seeing the addition of `fetchpriority=low` to be hurting LCP when the LCP
 element is a large Image block. This doesn't make sense to me.
 \\


 First LCP image should have always fetchpriority high, the perf hint
 combo:

 * Heavy non essential resources: imgs, videos, links, scripts (example
 heavy animation scripts) low priority

 * imgs, iframe and videos can/should be further optimized by lazy-loading,
 decoding async - something WP already someway does...

 * Heavy essential resources (like lcp image), hypothetically also fonts,
 and primary static content, can get high priority hint, with additionally
 extra links prefetch/preconnect/preload - or newest speculation api for
 scripts.

 ----

 * fonts than can have an additionally optimisation trick: using a font-
 display optional (with no swap timing, with no-blocking timing), and a
 link rel preload to that font, gives a really huge performance boost,
 fixing some loading issues; but this is more like a "pro-hack"; font-
 display fallback, usually is enough. 😅

 ----

 Otherwise adding wrong priority, or adding it to everything can lead the
 opposite results, as you said for the lcp image...

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


More information about the wp-trac mailing list