INP on a filtered catalog: where a Next.js headless storefront goes over 200 ms
A Next.js storefront loads fast, but a click on a filter checkbox lags. I go through five places in a faceted catalog where a click crosses the 200 ms INP threshold, how to fix them without rewriting the storefront, and how to find the slow click in field data.
Contents
A headless catalog can do fine on LCP: the first screen comes from the server and the images are optimized. Then a shopper clicks the “In stock” filter, and the checkbox shows as checked only after a noticeable delay. The page loaded fast, but the click is slow.
That delay is what Interaction to Next Paint (INP) measures. On March 12, 2024, INP replaced FID as a Core Web Vital, and it is now the metric for responsiveness. Below I walk through where a faceted catalog loses milliseconds, how to fix it without rewriting the storefront, and how to find the slow click in real shoppers’ data rather than only in Lighthouse.
What INP is and what counts as good
INP looks at every click, tap and key press during a visit and takes nearly the slowest interaction. Nearly, because the single slowest interaction is ignored for every 50 interactions. That only kicks in at 50 or more interactions per visit; otherwise INP is simply the slowest click.
The web.dev thresholds apply to the 75th percentile of page loads recorded in the field, segmented by mobile and desktop:
- 200 ms or less: good;
- above 200 ms and up to 500 ms: needs improvement;
- above 500 ms: poor.
Every interaction breaks down into three parts: input delay (the browser is still busy with something else), processing duration (your event handlers run), and presentation delay (from the end of the handlers to the next frame). It pays to fix the longest part, so first you need to see it.

Why a faceted catalog is especially exposed
A product page is mostly read. A catalog is something people operate: facets, sorting, “show more”, switching the view. The more interactions a page gets, the higher the chance that one of them is slow and ends up as the INP value.
Catalog size adds to the work. In a public case study, a catalog of about 28,000 products with offers (SKUs) moved to a Next.js storefront on top of 1C-Bitrix (a Russian PHP e-commerce platform, usually connected to 1C, the local ERP), with search and filters on Elasticsearch using regional indexes. Orders, prices and integrations stayed in Bitrix. On a catalog like that, one facet click changes the results, recalculates the counts of neighbouring filters and updates a URL that matters for SEO. Each of those steps is easy to make synchronous and heavy.
Five places where the milliseconds go
1. Hydrating a long product list
The server sends HTML with a grid of product cards, and the shopper sees the filters and clicks right away. But React is still hydrating the page, and while that long task (anything that holds the main thread for more than 50 ms) runs, the click waits. Input delay grows. In field data you can spot this through the loadState field: slow clicks happen while the page is still loading.
2. Re-rendering the whole grid for one checkbox
Filter state lives in the root catalog component. The checkbox changes it, and React re-renders the filter panel, every card, the pagination and the breadcrumbs. Processing and presentation delay both grow, because the browser recalculates style and layout for a large DOM. According to Lighthouse, a DOM over 1,400 nodes is excessive, and warnings start at 800. A grid of cards with prices, badges and variants crosses that line quickly.
3. Recalculating facet counts synchronously
Every filter value shows a product count. If the storefront recalculates those counts in the browser right inside onChange, looping over products and every facet value, the handler itself becomes a long task. That is pure processing duration: the frame with the checked box cannot be painted until the loop finishes.
// Hypothetical example: don't do this
function onFacetChange(next) {
setSelected(next); // the checkbox
setCounts(recountAllFacets(products, next)); // a heavy loop in the same handler
router.push(`/catalog?${toQuery(next)}`); // and a navigation on top
}4. Search requests that are never cancelled
A shopper ticks three brands in a row. Three requests go to Elasticsearch or the storefront API, and the responses come back in any order. Each response triggers a list render, and the last one to arrive may not be the last one sent: the screen shows results for two of the three brands. The extra renders occupy the main thread exactly when the person keeps clicking, which stretches the input delay of the next click.
5. Updating the URL on every click
Filters belong in the URL for SEO and so the results can be shared. But router.push in the App Router is a navigation: Next.js prepares the new route and re-renders the tree that depends on it. If that navigation starts in the same handler as the checkbox, all of it lands on the same click. For changing query parameters only, the Next.js docs suggest the native pushState and replaceState: they are integrated into the router, and Next.js schedules the useSearchParams update as a Transition.
What helps, point by point
| Where time is lost | Which part of INP | What helps |
|---|---|---|
| Hydrating a long list | Input delay | Less client code: filters as a separate client component, the first grid render on the server |
| Re-rendering the whole grid | Processing and presentation | List in a Transition, content-visibility or virtualization for a long grid |
| Counts recalculated in the handler | Processing duration | Counts from search in the same response, or chunked work that yields |
| Requests never cancelled | Input delay of the next click | AbortController for the stale request |
| URL via the router on every click | Processing and presentation | history.replaceState instead of a navigation |
There is one core technique: separate urgent work from non-urgent work. The checkbox should show as checked in the next frame, while the list, the counts and the URL can wait. In the example below, the grid is rendered on the server first and then updated on the client: the component fetches products and counts from an API and passes them up to the parent. useTransition marks a state update as a Transition; such updates are non-blocking and get interrupted by new clicks. AbortController cancels a request whose response is no longer needed. Put together, it looks like this:
// Hypothetical example: React 19, Next.js App Router, client component
'use client';
import { useRef, useState, useTransition } from 'react';
export function BrandFacet({ options, onResults }) {
const [selected, setSelected] = useState([]);
const [isPending, startTransition] = useTransition();
const request = useRef(null);
async function toggle(value) {
const next = selected.includes(value)
? selected.filter((v) => v !== value)
: [...selected, value];
setSelected(next); // urgent: the checkbox in the next frame
const params = new URLSearchParams(window.location.search);
if (next.length) params.set('brand', next.join(','));
else params.delete('brand');
request.current?.abort(); // the previous response is no longer needed
const controller = new AbortController();
request.current = controller;
try {
const res = await fetch(`/api/catalog?${params}`, { signal: controller.signal });
const data = await res.json(); // products and facet counts
startTransition(() => onResults(data)); // non-urgent: list and counts
window.history.replaceState(null, '', `?${params}`); // URL without a navigation
} catch (e) {
if (e.name !== 'AbortError') throw e;
}
}
return (
<fieldset aria-busy={isPending}>
{options.map((o) => (
<label key={o.value}>
<input type="checkbox" checked={selected.includes(o.value)}
onChange={() => toggle(o.value)} />
{o.label} <span>{o.count}</span>
</label>
))}
</fieldset>
);
}
One limitation: Transitions can’t be used for the state of a controlled text input. If a facet has a brand search box, update the text with a plain setState and filter the list inside the Transition.
Counts are better taken from search, in the same response as the products. In Elasticsearch they come from terms aggregations, plus filter aggregations for multi-select facets so that the counts of neighbouring facets stay correct. The client just shows ready numbers.
Long grids and long tasks
If the grid is long, the browser does not have to render cards below the fold. content-visibility: auto skips their rendering until the user scrolls near them. For very long lists with “show more”, virtualization helps.
/* Off-screen cards are not rendered until the user scrolls to them */
.product-card {
content-visibility: auto;
contain-intrinsic-size: auto 420px; /* approximate card height, use your own */
}If you really have to compute in the browser, split the work and yield to the main thread between chunks. scheduler.yield() is not available everywhere (as of December 2026, web.dev lists no Safari support), so keep a setTimeout fallback:
// Give the main thread back so the browser can handle input and paint a frame
function yieldToMain() {
if (globalThis.scheduler?.yield) return scheduler.yield();
return new Promise((resolve) => setTimeout(resolve, 0)); // fallback
}
async function recountInChunks(groups) {
for (const group of groups) {
recountGroup(group); // one facet group at a time
await yieldToMain();
}
}For hydration, a simple rule from the Next.js docs helps: don’t mark the whole catalog with 'use client'. The filter panel can be a small client component while the cards render on the server. The smaller the client tree, the shorter the hydration and the sooner the page is ready for a click.
Measure in the field, not only in Lighthouse
In its default mode, Lighthouse loads the page without clicking anything, so it can’t show your real INP. The order web.dev suggests is this:
- CrUX: is there a problem at all. Check INP in PageSpeed Insights for catalog pages, with mobile separately.
- The attribution build of the web-vitals library: which interaction is slow and which element was clicked (interactionTarget).
- Long Animation Frames: which script held the frame. web-vitals exposes this data as longAnimationFrameEntries and longestScript.
- The handler in your code: fix the specific facet, then check the field data again.

Sending the data to your own backend takes a few lines. The logic is simple: group by target and see which of the three INP parts is longest for the slow clicks.
// web-vitals 5, attribution build. /api/rum/inp is your own endpoint.
import { onINP } from 'web-vitals/attribution';
onINP(({ value, rating, attribution: a }) => {
navigator.sendBeacon('/api/rum/inp', JSON.stringify({
path: location.pathname,
value: Math.round(value),
rating, // good | needs-improvement | poor
target: a.interactionTarget, // CSS selector of the clicked element
type: a.interactionType, // pointer | keyboard
inputDelay: Math.round(a.inputDelay),
processing: Math.round(a.processingDuration),
presentation: Math.round(a.presentationDelay),
loadState: a.loadState, // was the page still loading?
script: a.longestScript?.entry.sourceURL // which script held the frame the longest
}));
});Where to start
- Collect field data: CrUX for the catalog, then web-vitals with attribution.
- Find the slow facet by interactionTarget and the longest part of INP.
- Separate the checkbox from the list update: filter state right away, the list in a Transition.
- Cancel stale requests and take the counts from the search response.
- Cut the rendering work for the grid: content-visibility, virtualization for long lists, less client code.
If facets are also a sales question for you, read the piece on facets that help people buy and why Elasticsearch is about UX, not just speed. How I work on a storefront on top of a live shop is described on the Next.js on top of Bitrix page, and search and filtering have their own service page.
Our LCP is good. Why does PageSpeed Insights flag INP?
LCP measures loading, INP measures how the page responds to actions. The causes are different, and so are the places where you fix them.
Lighthouse is green. Does that mean INP is fine?
No. In its default mode, Lighthouse does not click your facets, and INP comes from real visits. Look at CrUX field data and collect your own with web-vitals.
Do we need to rewrite the storefront to get under 200 ms?
Usually not. Start by finding the specific slow handler. Separating urgent and non-urgent updates, cancelling requests and reducing work on the grid are targeted changes.
Does useTransition make rendering faster by itself?
No, the amount of work stays the same. A Transition lets React keep urgent updates, such as the checkbox, unblocked and drop a stale list render if the person clicks again.
Can we keep filters in the URL for SEO?
Yes. Update the address with history.replaceState or pushState, which Next.js supports in the App Router, instead of a full navigation on every click.
Sources
- Interaction to Next Paint (INP)
- Interaction to Next Paint becomes a Core Web Vital on March 12
- Optimize Interaction to Next Paint
- Optimize long tasks
- How large DOM sizes affect interactivity, and what you can do about it
- content-visibility: the new CSS property that boosts your rendering performance
- Find slow interactions in the field
- useTransition
- AbortController
- Linking and Navigating
- Server and Client Components
- Terms aggregation
- Chrome UX Report (CrUX)
- web-vitals