How to Fix Core Web Vitals INP Issue detected on your website

by | Jul 12, 2023 | Technology

Google has started sending emails to users of their Search Console, informing them about issues related to INP (Interaction to Next Paint). INP is a new metric of Core Web Vitals that will replace FID in March 2024.

If you’ve also received the email regarding INP issues and you’re wondering how to fix them, don’t worry! This article will guide you through the steps to fix the problem and improve your INP score.

 

Content

Understand the INP Issue

INP aims to give better insights into how quickly a webpage becomes interactive after a user takes an action. By measuring this interaction time, INP helps identify performance bottlenecks and improve the overall user experience.

Read how the INP score is calculated

INP Issue Explained

INP gives a clearer picture of how smoothly and quickly a website responds to user input.

Read: How to Keep Your Google Account Active and Avoid Data Deletion

Analyze Core Web Vitals Report

Log in to your Search Console account and navigate to the Core Web Vitals report. Here, you’ll find detailed information about the performance of your webpages, including any INP-related issues.

Here is now you can find the affected pages in the Search Console:

  • Visit this page: https://search.google.com/search-console/core-web-vitals
  • Search the property (your website) and select the one you need to analyze.
  • You’ll see two reports (Mobile and Desktop).
  • Check which one has poor or needs improvement URLs.
  • Open the report and scroll to the bottom of the page to find the INP related information.

Additionally, you can also click on the Fix INP issue on the email received from google.

Email Notification From Google to fix INP Issue

Take note of the affected pages and their corresponding metrics.

Identify Potential Causes

Once you have identified the problematic pages, it’s time to investigate the potential causes.

Common factors that can affect INP include heavy JavaScript execution, slow server response times, or inefficient rendering processes. Look for any patterns among the affected pages.

One important metric to consider when evaluating the performance of a webpage is Total Blocking Time (TBT). TBT is closely linked to the concept of Input Delay and it measures how responsive a page is during the loading process.

If your TBT is indicating poor performance or in need of improvement, it suggests that there may be certain interactions on your page that are causing delays during the loading phase.

To assess your page’s TBT, you can make use of a tool like PageSpeed Insights.

How to fix INP Issue

Let’s explore some practical strategies to optimize poor INP to ensure a smooth browsing experience for your users.

Minimizing JavaScript

Take a closer look at the JavaScript code used on your pages and identify any heavy or unnecessary scripts that could be impacting performance. Consider removing or optimizing them to reduce the overall file size.

Additionally, employing lazy loading techniques can help load JavaScript files only when they are required, which improves initial page load times.

Some more important points to keep in mind when trying to optimize your JavaScript:

  • Optimize Long Tasks: Long tasks can cause poor INP by monopolizing the browser’s main thread, which delays user interactions. Breaking down these tasks into smaller, manageable chunks allows the browser to handle other actions promptly while processing these tasks.
  • Reduce Input Delay: Input delay occurs when there’s a noticeable lag between a user’s action (like clicking a button) and the website’s response. To minimize input delay, focus on reducing the execution time of event handlers and avoiding unnecessary computations during user interactions. By streamlining your code and optimizing event handling, you can make your website more responsive.
  • Script Evaluation: Script evaluation can contribute to poor INP if JavaScript files take too long to parse and evaluate. Minify and compress your JavaScript files to reduce their size, helping the browser render pages faster. Additionally, consider placing script tags at the bottom of your HTML document or using asynchronous loading techniques to avoid blocking the rendering process.
  • Utilize Web Workers: Web workers allow you to run JavaScript off the browser’s main thread. By leveraging web workers, you can perform resource-intensive tasks without blocking the main thread, resulting in improved responsiveness. This is particularly useful for tasks like data processing and image manipulation.

Streamlining Rendering

Ensure that your CSS and HTML are optimized for efficient rendering. Eliminate render-blocking resources, such as external stylesheets and scripts, that hinder the browser from quickly rendering the page.

This can be achieved by placing critical CSS inline or deferring non-critical styles. Prioritize the loading of critical above-the-fold content to expedite the initial rendering process.

  • Avoid Large, Complex Layouts and Layout Thrashing: Complex layouts with nested elements can slow down rendering. Simplify your page structure and reduce unnecessary nesting to improve rendering performance. Additionally, be mindful of layout thrashing, which happens when frequent changes to element dimensions trigger repeated reflows. Batch updates together to minimize layout thrashing and enhance performance.
  • Simplify Style Calculations: Style calculations can consume significant browser resources, especially with large CSS files or intricate styling rules. Simplify your stylesheets, remove unused styles, and consider using CSS preprocessors to optimize style calculations and reduce their impact on rendering performance.
  • Manage DOM Sizes: Excessive DOM sizes can hinder interactivity and slow down JavaScript execution. Evaluate your DOM structure and seek areas where optimizations can be made. Consider lazy loading techniques, pagination, or dynamically rendering content to keep the DOM size manageable for smooth user interactions.
  • Balance Client-Side Rendering: Client-side rendering (CSR) can provide dynamic and interactive experiences but may impact performance if not implemented carefully. Find the right balance between server-side rendering (SSR) and CSR based on your specific use case. Use techniques like code splitting, caching, and efficient data fetching to optimize client-side rendering for good performance.

Improving Server Response Times

Evaluate your server infrastructure to identify potential bottlenecks causing delays. Optimize server configurations by fine-tuning settings such as server software, database queries, and caching mechanisms.

Implementing caching mechanisms reduces the need to generate dynamic content with each request, resulting in faster response times.

Furthermore, leveraging content delivery networks (CDNs) allows for the distribution of static assets across multiple servers, closer to site visitors, reducing latency.

Prioritizing Interactivity

Optimize user interactions on your pages to provide fast responses. Use efficient event handlers that minimize processing time.

Reduce the delay between a user action (such as clicks or taps) and the corresponding response from the webpage. To accomplish this, optimize client-side scripting and utilize asynchronous operations whenever possible.

The goal is to create a responsive and interactive website that enhances the overall user experience.