Performance

Duplicate Fetches Are the Cheapest Win on a Slow Page

Two identical requests on mount is a bug with a number attached, not an architectural problem.

1 min readPublished August 20, 2026
Share on X

When auditing React and Next.js applications, I consistently see the same anti-pattern: five independent components on the page all making the exact same HTTP request on initial mount.

The navbar fetches `/api/user`. The profile badge fetches `/api/user`. The notification counter fetches `/api/user`. The sidebar fetches `/api/user`.

The cost of uncoordinated data fetching

Four identical requests are sent across the wire simultaneously. The browser opens multiple connections, the backend handles four queries, and React triggers multiple re-renders as each promise resolves out of order. It turns what should be a snappy dashboard into a jittery, sluggish experience.

Deduplication is a one-line abstraction

You do not need a massive state management library to fix this. A simple in-flight promise cache or lightweight hook deduplicates requests at the network layer:

const inflight = new Map();

export function fetchDedupe(url, options) {
  if (inflight.has(url)) return inflight.get(url);

  const promise = fetch(url, options)
    .then((res) => res.json())
    .finally(() => inflight.delete(url));

  inflight.set(url, promise);
  return promise;
}

By caching the in-flight promise rather than just the final data, concurrent component mounts automatically latch onto the same single network call. One request leaves the browser, one response returns, and all components update in unison.

  • Performance
  • React
  • Backend
KI

Kadirul IslamVerified author

Founder, A.K Solution

Follow on X

Founder of A.K Solution. Full-stack engineer building AI agent tools like KiCode, JSON form engines like ki-forms, and high-scale SEO systems. Obsessed with shipping fast, zero-bloat software that lasts.

More from Kadirul Islam

A Slow App Is Often Just a Database Waking Up

Free tiers suspend on idle. The first request after a pause pays a cold start, and it looks exactly like a slow product.

2 min readPerformance

The Index You Meant to Create

I wrote the migration, the model was correct, and the production database never saw it. Full-table scans for weeks.

1 min readDatabases