-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate INP improvements #1120
Comments
This also adds some pressure to explore the Partytown band aid (#176) to mitigate the symptoms of these third party script performance problems. |
The common mitigation for optimizing third party code performance is to delay their Javascript from loading until user interaction (scroll, click, tap, mouse movement etc). This negates their performance impact as the code is not downloaded at all in the initial render and not loaded until needed. Plugins like Perfmatters or Debloat utilize this method. Could javascript delay functionality be built into core at an API level and exposed to developers? |
@jazir555 sounds like a good area to investigate. In addition to delaying the download until user interaction, this should also yield to the main thread before executing the script as well. |
Another complementary strategy is to locally host the third party code. There are many plugins which do this for various types of resources. Locally hosting files eliminates network latency as no additional connections have to be established with a third party domain, which improves performance. Some examples: CAOS (Locally Host Google Analytics): https://wordpress.org/plugins/host-analyticsjs-local/ OMGF (Locally Host Google Fonts): https://wordpress.org/plugins/host-webfonts-local/ There is even an unmaintained plugin to locally host any third party js/css file. HELL (Host Everything Locally): https://github.com/Dan0sz/host-everything-locally But I think that can be taken even further. I propose that core should add the ability to locally host any file type via a dedicated Wordpress API. There could be a settings panel where urls for resources could be manually added, as well as the ability to automatically download external resources to be served locally. This would be especially useful for filetypes none of the above plugins can locally download, such as non-google fonts, as well as SVGs, video, etc. This would require some sort of search and replace functionality to update the urls within the html to ensure plugins and themes are serving the locally hosted copy of the file, and to eliminate the external HTTP requests to the third party server. In the case of SVGs and Font Files, this opens up some interesting capabilities, as it would then be possible to compress the SVGs, and also optimize the font files (font subsetting, font filetype conversion to WOFF2, glyph stripping, etc). |
Overview
INP is the new metric for interactivity that is one of the Core Web Vitals. The goal of this issue is to track work on issues raised in the INP research document and develop mitigations or suggestions for improvements.
Details
Core
Plugins
Many of the issues noted in the research document are related to specific plugins.
lazysizes
script which is causing issues, we should investigate an upstream fix or dropping use when not needed (eg native lazy loading, improved sizes)Third parties
Task tracking
... more items to be added as they are created ...
The text was updated successfully, but these errors were encountered: