Home › Core Web Vitals › CDN INP Optimization
Core Web Vitals

Interaction to Next Paint: How CDN Edge Computing Reduces INP

By Sarah Mitchell, Edge Computing Engineer • September 3, 2026 • 9 min read

Interaction to Next Paint (INP) replaced First Input Delay as a Core Web Vital in March 2024, and it remains the most challenging metric to optimize. Unlike LCP, INP measures responsiveness throughout the entire page lifecycle — every click, tap, and keypress. CDN edge computing is now the most effective infrastructure lever for consistently hitting the <200ms “good” threshold.

Most teams approach INP as a purely front-end problem: reduce JavaScript, break up long tasks, optimize event handlers. Those matter, but they ignore half the equation. Every interaction triggers network work — fetches, API calls, revalidation, personalization — and that network latency directly extends the time until the next paint.

Edge computing moves that network work from a distant origin to a PoP 20-50ms away from the user. When done correctly, it can shave 150-400ms off interaction latency without rewriting your application.

INP Is Not FID: Understanding the Three Sub-Parts

Google defines INP as the time from user interaction to the next frame being painted, observing all interactions and reporting a high percentile (p98). A single slow interaction poisons the score. To optimize it, you must decompose it:

CDN edge computing primarily attacks Input Delay and Presentation Delay, the two phases most impacted by network architecture. Processing Time is still your code’s responsibility, but edge can reduce how much code needs to run on the client at all.

Key threshold: Good INP is ≤200ms, Needs Improvement is 200-500ms, Poor is >500ms. Field data from CrUX shows the median mobile INP is ~180ms, but the p75 for JavaScript-heavy SPAs often exceeds 350ms.

Why Traditional CDN Caching Barely Moves INP

A classic pull-through CDN accelerates static assets — images, CSS, JS bundles. That helps LCP and FCP, but interactions are dynamic. A click on “Add to Cart,” a filter selection, or an autocomplete keystroke typically bypasses cache and goes to origin.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages

If your origin is in us-east-1 and your user is in Bentonville, Arkansas, that round trip is 60-90ms before TLS and application logic. Add a second call for personalization or inventory, and you’ve already burned your entire 200ms budget before the browser can paint. This is why sites with excellent Lighthouse lab scores still fail INP in the field.

To understand the baseline, see how a CDN works and how caching strategies handle static vs. dynamic content. Edge computing is the next layer: programmable logic at the edge that can respond without hitting origin.

TRADITIONAL ORIGIN FLOW EDGE COMPUTING FLOW 👆 Interaction BROWSERmain thread ORIGIN120-300ms RTT Presentation Delay: 180-450msINP = Poor 👆 Interaction BROWSERmain thread EDGE PoP15-40ms RTT Next PaintINP < 120ms
Traditional origin round-trips inflate Presentation Delay. Edge PoPs cut network time by 70-85%, leaving budget for rendering.

5 Edge Computing Strategies That Directly Reduce INP

1. Edge-Cached API Responses for Interaction-Critical Fetches

Autocomplete, product filtering, inventory checks, and recommendation carousels all fire fetches on interaction. Cache them at the edge with short TTLs and stale-while-revalidate.

Instead of Cache-Control: private, no-store, use edge-aware headers: CDN-Cache-Control: max-age=30, stale-while-revalidate=60 plus Vary: Accept-Language, Cookie patterns handled by the edge. For authenticated carts, use edge dictionaries to cache per-user fragments with surrogate keys and purge on mutation. This turns a 180ms origin fetch into a 15ms edge hit.

2. Move Personalization and A/B Logic Off the Main Thread

Client-side personalization is an INP killer. It blocks rendering while JavaScript decides which variant to show. Shift that logic to an edge worker that rewrites HTML before it reaches the browser.

The worker reads cookies/geo headers, selects the variant, and streams the correct HTML. The browser receives final markup — no flicker, no extra JS, no layout shift. This alone often removes 50-120ms of Processing Time and eliminates hydration mismatches that cause long tasks.

3. Edge HTML Streaming + 103 Early Hints

INP suffers when the main thread is busy hydrating a large SPA bundle. Edge streaming lets you flush the document head early with 103 Early Hints for interaction-critical scripts, while streaming the body in chunks.

Prioritize the event-handler bundle and defer the rest. Pair this with image optimization at the edge so heavy images never compete with interaction handlers for bandwidth or decoding time.

4. Offload Non-Critical Work to Edge Workers

Analytics beacons, feature flag evaluation, bot checks, and even image resizing should not run on the main thread. Edge workers can handle them asynchronously. For example, validate a form submission at the edge, return an optimistic UI update in <40ms, and reconcile with origin in the background.

This pattern is especially powerful for e-commerce. Combined with performance and security benefits of a CDN, you reduce both Input Delay and server load.

5. Intelligent Prefetch and Preconnect from the Edge

Use edge-injected Speculation Rules or Link: rel=prefetch headers based on real user navigation patterns. If 68% of users who click “Fly Rods” next click “Nymphs,” the edge can hint the browser to prefetch that API response with low priority. When the interaction happens, the data is already in the HTTP cache — Presentation Delay drops to near zero.

Measuring INP Correctly Before and After Edge Deployment

Lab tools like Lighthouse simulate a single interaction and underreport INP. You need field data.

// Measure INP in production with web-vitals (v4+)
import { onINP } from 'web-vitals';

onINP(({ value, attribution }) => {
  // value is in milliseconds
  console.log('INP:', value);
  console.log('Target:', attribution.interactionTarget);
  console.log('Input delay:', attribution.inputDelay);
  console.log('Processing:', attribution.processingDuration);
  console.log('Presentation:', attribution.presentationDelay);
  // Send to analytics if value > 200
  if (value > 200) {
    navigator.sendBeacon('/analytics/inp', JSON.stringify(attribution));
  }
});

Segment by interaction type. In our audits, “filter change” and “add to cart” account for 70% of poor INP cases. Those are precisely the interactions that benefit from edge-cached APIs.

Edge TechniqueINP Phase ImprovedTypical SavingsEffort
Edge API caching (SWR 30s)Presentation Delay120–250 msLow
Edge personalization rewriteInput Delay + Processing60–140 msMedium
103 Early Hints + streamingInput Delay40–90 msMedium
Edge worker for validationProcessing + Presentation80–180 msMedium
Speculative prefetchPresentation Delay100–300 msHigh
Edge image optimizationPresentation Delay30–70 msLow

Edge Worker Example: Optimistic Cart Update

Here’s a simplified Cloudflare/Fastly-style worker that serves a cached cart fragment and updates origin asynchronously — reducing perceived INP for “Add to Cart”:

export default {
  async fetch(request, env, ctx) {
    const url = new URL(request.url);
    if (url.pathname === '/api/cart/add' && request.method === 'POST') {
      // 1. Serve optimistic response from edge in <20ms
      const cachedCart = await env.CART_CACHE.get(request.headers.get('cookie'));
      const optimistic = cachedCart ? JSON.parse(cachedCart) : { count: 0 };
      optimistic.count += 1;

      // 2. Reconcile with origin in background (doesn't block paint)
      ctx.waitUntil(
        fetch('https://origin.flyfishnwa.com/api/cart/add', request)
          .then(res => res.json())
          .then(data => env.CART_CACHE.put(request.headers.get('cookie'), JSON.stringify(data)))
      );

      return new Response(JSON.stringify(optimistic), {
        headers: {
          'Content-Type': 'application/json',
          'Cache-Control': 'no-store',
          'Server-Timing': 'edge;dur=18'
        }
      });
    }
    return fetch(request);
  }
}

The browser paints the updated cart count immediately. Even if origin takes 250ms, the user already saw the next frame — INP stays under 100ms. Pair this with a proper cost optimization strategy to avoid runaway worker invocations; cache hit ratios above 85% keep edge compute costs predictable.

Implementation Checklist

  1. Audit field INP by interaction type using CrUX + web-vitals attribution. Identify top 3 slow interactions.
  2. Enable edge caching for those APIs with CDN-Cache-Control and surrogate keys. Aim for 80%+ edge hit rate.
  3. Deploy Early Hints for interaction-critical JS/CSS. Verify with curl -I that 103 is served from PoP.
  4. Migrate personalization to edge workers — remove client-side flicker scripts and measure INP delta in A/B.
  5. Stream HTML and defer hydration. Use requestIdleCallback for non-critical work.
  6. Monitor continuously: Alert if p75 INP >200ms for 3 consecutive days in any geo.

Teams that combine front-end hygiene (breaking up long tasks to <50ms, avoiding forced reflows) with edge acceleration consistently achieve p75 INP of 120-160ms, even on mid-range Android devices. Without edge, the same code often lands at 280-400ms due to network variance alone.

Edge computing doesn’t replace good JavaScript — it gives your good JavaScript room to breathe. By eliminating the network tax on every interaction, you reclaim the budget needed to deliver instant, app-like responsiveness on the web.

Frequently Asked Questions

How does edge computing directly improve INP?

Edge computing runs logic 20-50ms from the user instead of 100-300ms at origin. It caches interaction-critical API responses, streams HTML with Early Hints, and moves personalization off the main thread. This cuts Input Delay and Presentation Delay by 80-300ms per interaction, directly lowering INP.

What is a good INP score and how is it measured?

Good is ≤200ms, Needs Improvement is 200-500ms, Poor is >500ms. INP is measured in the field across the entire page lifecycle — every click, tap, and keypress is observed and the 98th percentile worst latency is reported via the web-vitals library and Chrome UX Report.

Can a CDN alone fix poor INP without code changes?

No. A basic CDN that only caches static assets won’t fix INP, which is driven by main-thread blocking and JavaScript execution. You need edge compute capabilities — workers, streaming, and API caching — plus front-end fixes like splitting long tasks and reducing unused JavaScript.

Which edge strategies have the biggest impact on INP?

Edge-cached APIs for autocomplete, filters, and cart actions have the largest impact (120-250ms saved), followed by edge personalization that removes client-side variant logic, and speculative prefetch of next-navigation data. Early Hints and edge image optimization provide additional 30-90ms gains.

References & Standards: W3C Web Performance · OWASP CDN Security