Improving your site's First Input Delay depends on optimizing your use of JavaScript and third-party scripts. The latter are often referenced by website analytics tools and any code that calls a script from another website. As mentioned earlier, you can optimize your use of JavaScript by minifying (removing unnecessary characters) from your scripts, removing unused code, and moving code that is not needed for the initial page load to preload resources. Use the Coverage feature of Google Chrome DevTools to identify code that can be offloaded to preload resources. Google recommends UglifyJS to minify JavaScript. You can also use HTML Minifier and CSS to minify HTML using CSSnano and CSSo . You can learn more about the technical details behind the Event Timing API for analyzing user interaction latency in the W3C Community Group's report .
To improve the CLS score of your web pages, you need to tell the browser how much space to allocate to elements as they load. You can do this by adding specific size attributes to images and videos. Alternatively, you can paraguay mobile database use aspect-friendly boxes in your CSS. Both will achieve the intended goal of preventing content from accidentally moving around as the page loads. Using in-page indicators is also recommended for elements that move as they load after a user interacts with the page. Letting users know that an element is loading on the page may prevent them from clicking to move the element.
We’ve divided the questions in this article into three sections: Metrics and Tools, Page Experience and Search, and AMP. We hope you find these useful.