Open
Description
Impacted plugin
Jetpack
What
Add fetchpriority=low
to the Stats script and remove the dns-prefetch
link
How
To attempt to reduce network contention with loading resources in the critical rendering path (e.g. the LCP element image), I suggest deprioritizing the Stats script by:
- Adding
fetchpriority="low"
to thescript
tag. - Removing the
dns-prefetch
forstats.wp.com
.
This does not primarily benefit Chrome since that browser already gives async
scripts a priority of low. It does benefit Safari and Firefox, however, since they have a default medium/normal priority.
I created an extension plugin to demonstrate the changes: Jetpack Stats Script Deprioritization.
I published a full writeup as well: Improve LCP by Deprioritizing Script Modules from the Interactivity API.