Contributors: westonruter
Tested up to: 6.8
Stable tag: 0.1.0
License: GPLv2 or later
Tags: performance
This plugin deprioritizes the loading of the Stats script in the Jetpack plugin to attempt to reduce network contention with loading resources in the critical rendering path (e.g. the LCP element image). It deprioritizes the 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.
For an example of the performance impact for this change, see the Site Kit GTag Script Deprioritization plugin.
I've proposed these changes for inclusion in Jetpack.
- Download the plugin ZIP from GitHub or if you have a local clone of the repo run
npm run plugin-zip
. - Visit Plugins > Add New Plugin in the WordPress Admin.
- Click Upload Plugin.
- Select the
jetpack-stats-script-deprioritization.zip
file on your system from step 1 and click Install Now. - Click the Activate Plugin button.
You may also install and update via Git Updater.
- Initial release.