As Google’s Core Web Vitals continue to evolve, Interaction to Next Paint (INP) has emerged as a critical metric for e-commerce success. For Magento (Adobe Commerce) merchants, providing a high-performance shopping experience is no longer just about how fast a page loads; it is about how responsive the page feels once the user starts clicking, tapping, or typing.
This guide provides an in-depth exploration of how to optimize INP specifically for the Magento ecosystem, moving beyond general advice to address the unique architecture of the platform.
Nội dung bài viết
Understand INP and Its Impact on E-Commerce
Interaction to Next Paint (INP) is a Core Web Vital that observes the latency of all interactions a user makes with a page throughout its lifespan. Unlike First Input Delay (FID), which only measures the very first interaction, INP accounts for every click, tap, and keyboard entry. The final INP value is usually the longest interaction observed (or an average for very long sessions).
Magento is a powerful but “heavy” enterprise platform. A typical Magento store carries significant overhead:
- Complex Product Catalogs: Large DOM structures due to extensive attribute sets.
- Dynamic Checkouts: Highly interactive steps that require constant validation and server communication.
- Rich UI/UX: Features like Quick View, Mini-carts, and layered navigation that rely heavily on JavaScript.
A poor INP score (above 200ms) signals to Google that your site is sluggish. This results in higher bounce rates, lower conversion rates, and a potential drop in search engine rankings.
To learn more about improving Magento 2 Core Web Vitals and boosting your store’s performance, check out our detailed guide: https://bsscommerce.com/magento/blog/magento-2-core-web-vitals/.

Identify Common Magento Causes of Poor INP
Before diving into fixes, you must understand why Magento often struggles with interaction latency.
Heavy JavaScript Execution
Magento 2’s default architecture relies on RequireJS and Knockout.js. While functional, these technologies often lead to a “Main Thread” that is constantly busy. When the Main Thread is occupied executing large JavaScript files, it cannot respond to user clicks, leading to high INP.
Slow Server-Side Communication
Magento interactions often trigger AJAX requests—for example, updating a mini-cart or applying a discount code. If the server response is slow due to unoptimized PHP code or a non-indexed database, the “processing time” portion of INP spikes.
Large DOM Tree
Magento themes, especially those built on older Page Builder versions or complex CSS frameworks (like Luma or Bootstrap-based themes), tend to produce deep HTML nesting. A large Document Object Model (DOM) makes it harder for the browser to recalculate styles and “paint” the next frame after a user interaction.
Third-Party Extensions
The Magento Marketplace is vast, but not every extension is built with performance in mind. Tracking pixels, chatbots, and “Frequently Bought Together” widgets often inject unoptimized scripts that block user interactions.
Practical Magento-Specific Improvements
Optimizing INP requires a multi-layered approach targeting JS delivery, server efficiency, and front-end rendering.
Optimize JavaScript Delivery
JavaScript is the primary culprit for INP issues. You must minimize the time the browser spends parsing and executing code.
- Defer and Async JS: Ensure non-critical scripts do not block the initial rendering. You can modify your theme’s default_head_blocks.xml to include defer=”defer” for specific scripts.
- Native Magento Settings: Navigate to Admin → Stores → Configuration → Advanced → Developer. Under “JavaScript Settings,” enable Merge JavaScript Files and Minify JavaScript Files. Note: In production mode, these are essential, but “Bundling” should be used cautiously as it can sometimes create excessively large files if not configured via a custom build-config.js.
- Identify Unused JS: Use the Chrome DevTools Coverage tab. If a script (like a slider library or a popup manager) has 90% unused code on the homepage, consider using programmatic loading to only fetch it when needed.
![]()
Optimize Front-End Performance and Caching
A responsive front-end depends on a fast back-end.
- Full Page Cache (FPC): Ensure Full Page Caching in your Magento store is enabled and using Varnish. Varnish acts as a high-speed middleman, serving cached HTML in milliseconds. While INP measures the client-side response, a fast server response for AJAX-driven interactions (like category filtering) significantly lowers the total interaction time.
- Reduce DOM Size: Audit your .phtml templates. Remove unnecessary <div> wrappers. For mega-menus, avoid loading the entire category tree in the HTML if the user hasn’t hovered over the menu yet.
- Lazy Load Non-Critical Elements: Use the native loading=”lazy” attribute for images and ensure that off-screen sliders do not initialize until the user scrolls near them.
Improve Server Infrastructure
If the underlying infrastructure is slow, even the best front-end code will suffer during interactions that require server feedback.
- PHP 8.2+ Upgrade: Modern versions of PHP offer significant performance gains over older 7.x versions. Magento 2.4.x versions are optimized for PHP 8.1 and 8.2.
- Redis for Sessions and Cache: Moving your cache and session storage from the filesystem to Redis reduces I/O bottlenecks. This is particularly important for the “Add to Cart” interaction, which writes data to the session.
- Database Optimization: Use a tool like MySQL Tuner to ensure your buffers are correctly sized. Regularly clean the customer_visitor and log_ tables, as bloated logs can slow down the queries triggered during user interactions.
Reduce Third-Party Blocking
Every third-party script is a potential INP “blocker.”
- Audit Extensions: Regularly disable extensions in a staging environment to see if INP improves. If a “Social Share” or “Live Chat” plugin is causing 500ms of Main Thread blocking, look for a lighter alternative.
- Google Tag Manager (GTM) Optimization: Move non-essential tracking pixels to a “window load” trigger rather than “DOM ready.” This ensures the browser handles user interactions first before processing tracking data.
Optimize Theme and UI Design
The architecture of your theme determines your “baseline” INP.
- Server-Side vs. Client-Side Rendering: For product grids, rely on server-side rendering (SSR) whenever possible. Avoid using heavy JavaScript frameworks to render simple lists of products, as this requires the browser to “hydrate” the data before it becomes interactive.
- Prioritize Above-the-Fold Interactions: Ensure the search bar and navigation menu are interactive immediately. Use priority hints for critical assets.
- Hyvä Themes: If you are struggling with a legacy Luma-based theme, consider migrating to Hyvä. Hyvä replaces the complex RequireJS/Knockout stack with Alpine.js and Tailwind CSS, which drastically reduces JS execution time and inherently improves INP.
Theme-level decisions such as rendering strategy, JavaScript framework choice, and HTML structure directly influence crawl efficiency, page experience signals, and long-term search performance. Understanding how different Magento theme architectures affect both SEO and performance is essential before committing to front-end optimizations.
How to Measure and Test INP for Magento
You cannot improve what you do not measure. Testing INP is different from testing LCP (Largest Contentful Paint) because it requires active participation.
Automated Tools
- PageSpeed Insights (PSI): Provides field data (Real User Metrics) and lab data. Look at the “Origin Summary” to see how actual users experience your Magento store over the last 28 days.
- Chrome User Experience Report (CrUX): This is the source for Google’s ranking data.
Manual Testing with DevTools
To find exactly which element is slow:
- Open Chrome DevTools → Performance tab.
- Check the Web Vitals box.
- Hit Record and manually interact with your store (click the “Add to Cart” button, open a dropdown, type in the search bar).
- Look for the Interactions lane in the timeline. Red bars indicate long interactions. Click on them to see the “Summary” which breaks down the delay into Input Delay, Processing Duration, and Presentation Delay.
Key Magento Interaction Points to Test:
- Product Page: Clicking “Add to Cart” (watch for session writes and mini-cart updates).
- Category Page: Selecting a filter in the Layered Navigation (watch for AJAX re-rendering).
- Checkout: Moving between shipping and payment steps (watch for address validation logic).
Advanced Strategies for Superior Interaction Speed
For high-volume Magento stores, basic optimization might not be enough to reach the “Good” threshold.
Code Splitting
Standard Magento bundles all JS for a page into a few large files. Advanced developers use Webpack or custom RequireJS configurations to implement code splitting. This ensures that the JavaScript for the “Reviews” section isn’t loaded or parsed until the user actually scrolls to the reviews tab, keeping the Main Thread free for buy-button interactions.
Preconnect and Preload
Use preconnect for third-party domains (like payment gateways or font providers) to reduce the connection time when an interaction triggers a request to those domains.
XML
<link rel=”preconnect” href=”https://js.stripe.com”>
Real User Monitoring (RUM)
Tools like New Relic, Datadog, or specialized Vitals trackers (like Vercel’s Speed Insights or Akamai) provide real-time data on how users are experiencing your site. This is invaluable because lab tests often miss the “long tail” of slow interactions that occur on low-end mobile devices or slow 4G connections.
Debouncing and Throttling
If your Magento store uses custom JS for features like “Search-as-you-type” or window resizing, ensure you implement debouncing. This prevents the script from running dozens of times per second, which would otherwise seize the Main Thread and spike INP.
Conclusion
Improving INP for Magento is a marathon, not a sprint. By systematically reducing JavaScript execution time, optimizing server responses, and trimming the DOM, you can create a store that feels instantaneous to the user. This not only satisfies Google’s algorithms but, more importantly, provides the friction-free shopping experience that drives modern e-commerce growth.