Reduce Time to Interactive on JavaScript Marketing Sites

Learn how to measure and reduce Time to Interactive on JavaScript-heavy marketing sites with bundle splitting, lazy loading, and hydration strategies.

Reduce Time to Interactive on JavaScript Marketing Sites

A two-second delay costs you the click

Google’s own research shows that as page load time goes from one second to three seconds, the probability of bounce increases by 32%. On JavaScript-heavy marketing sites, the culprit is almost always Time to Interactive (TTI): the moment a page looks ready but refuses to respond to a tap or scroll. You rebuilt on a modern framework. The design is sharp. And your prospects are staring at a frozen hero section, waiting for 1.8 MB of hydrating JavaScript to finish executing.

TTI is where framework-based rebuilds quietly fail. The markup arrives fast, the Largest Contentful Paint looks fine, and then the main thread locks up for four or five seconds while React, Next.js, Nuxt, or Astro boots the component tree. This article covers how to measure that gap, set a realistic budget for it, and apply the three strategies that consistently bring TTI under target: bundle splitting, lazy loading, and selective hydration.

Get a TTI audit that pinpoints your costliest JavaScript bottlenecks.

Request your performance review

What TTI actually measures (and why your framework inflates it)

TTI marks the point at which the page is visually complete and the main thread has been idle for at least five seconds with no long tasks (tasks exceeding 50 ms) blocking input. Lighthouse deprecated TTI as a weighted metric in its performance score, but the underlying problem has not gone away. It has simply been absorbed into Interaction to Next Paint (INP) and Total Blocking Time (TBT). A page with a high TTI will almost always show poor INP in the field, because the same long tasks that delay interactivity also delay the browser’s response to the first click.

Why do framework rebuilds make this worse? Server-side rendering (SSR) and static generation produce HTML fast. The browser paints that HTML while the JavaScript bundles download in parallel. But once the bundles arrive, the framework must “hydrate” the page: attach event listeners, reconcile its virtual DOM with the real one, and initialize every component. On a marketing site with an animated hero, a sticky nav, a video player, a chat widget, three analytics tags, and a cookie consent modal, hydration can block the main thread for 2,000 to 4,000 ms on a mid-range mobile device.

The first step is measurement. You cannot reduce what you have not profiled.

Measuring TTI without guessing

Lab tools give you a controlled baseline. Field data tells you what real visitors experience. You need both.

The goal is not to reach a perfect Lighthouse score. The goal is to make the primary CTA respond within 100 ms of the user’s first tap on the slowest device your analytics say matters.

1

Lighthouse CI in your build pipeline:

Run Lighthouse on every pull request against a simulated Moto G Power on a throttled 4G connection. Record TBT (the lab proxy for TTI) and set a threshold. A TBT above 300 ms on mobile is a signal your JavaScript budget is blown.

2

Chrome DevTools Performance panel:

Open the Performance tab, enable CPU 4x slowdown, and record a page load. Look for long tasks (highlighted in red). Each one is a chunk of JavaScript monopolizing the main thread. Note which scripts own the longest tasks.

3

WebPageTest with scripted interactions:

Use WebPageTest to simulate a click on your primary CTA immediately after visual completion. The filmstrip view will show you exactly when the button becomes responsive.

4

CrUX and RUM data:

The Chrome UX Report provides field-level INP and TBT distributions for your origin. If 25% or more of your sessions show INP above 200 ms, you have a TTI problem in production, regardless of what your lab numbers say.

5

Source-map-explorer or bundlephobia:

Before you optimize delivery, understand the payload. Run source-map-explorer against your production bundles to see which dependencies consume the most bytes. Moment.js at 230 kB gzipped is a different problem than a 40 kB animation library.

Bundle splitting: ship only what the route needs

A single-bundle build ships the code for every page on every page load. On a ten-page marketing site with a blog, a pricing calculator, and a product tour, that means the visitor loading your homepage also downloads and parses the calculator’s charting library and the tour’s animation engine. Bundle splitting breaks that monolith into route-level chunks so the browser only fetches what the current page requires.

Every major framework supports this natively. Next.js does automatic route-based code splitting. Nuxt does the same. Astro ships zero JavaScript by default and only loads component scripts when you explicitly opt in. If you are on a custom Webpack or Vite build, dynamic import() at the route level is the mechanism.

But route-level splitting is the floor, not the ceiling. Within a single route, you likely have heavy components that are not visible on initial load. A pricing calculator below the fold, a testimonial carousel, a live chat widget. These should be split into their own chunks and loaded on demand. The strategy overlaps with lazy loading, covered next, but the build configuration is distinct: you need to ensure your bundler creates separate chunks for these components rather than inlining them into the route bundle.

A practical check: after splitting, your initial route chunk (excluding the framework runtime) should be under 50 kB gzipped for a typical marketing page. If it is larger, run source-map-explorer again and look for dependencies that snuck in through a shared utility file or a barrel export. Setting a front-end performance budget makes this check automatic in CI.

Lazy loading: defer what the viewport does not need yet

Lazy loading is the runtime companion to bundle splitting. Where splitting determines which chunks exist, lazy loading determines when they are fetched and executed.

Images and iframes have native browser support via the loading="lazy" attribute. That part is straightforward. The harder problem on JavaScript-heavy sites is lazy loading components. A React component wrapped in React.lazy() and a Suspense boundary will not load its chunk until the component mounts. Combine this with an Intersection Observer that only mounts the component when it scrolls into view, and you have removed that code from the critical path entirely.

Here is where many teams make a mistake: they lazy load everything below the fold but forget about third-party scripts that execute immediately. An analytics snippet, a heatmap recorder, or an A/B testing SDK that blocks the main thread for 200 ms on init will wipe out the gains you made by deferring your own components. Audit every third-party tag. Load non-critical tags with requestIdleCallback or behind a user interaction trigger (scroll, click, or a two-second timeout).

A practical sequence for a typical marketing homepage:

1

Critical (loaded immediately):

Navigation, hero section, primary CTA, above-the-fold images, cookie consent logic (if legally required before interaction).

2

Deferred to idle (requestIdleCallback or setTimeout):

Analytics, heatmaps, chat widget initialization, A/B testing SDK.

3

Deferred to viewport intersection:

Testimonial carousel, video embed, pricing calculator, footer components, below-the-fold images.

4

Deferred to user intent:

Chat widget UI (load on hover or click of the chat icon), interactive product tours (load on CTA click).

Selective hydration: the strategy most rebuilds miss

Full-page hydration is the default in Next.js and Nuxt. The server renders the HTML, the browser downloads the JavaScript, and the framework re-renders the entire component tree to attach interactivity. On a marketing page where 70% of the content is static text, images, and layout, you are hydrating components that have no event listeners and no client-side state. That is wasted main-thread time.

Selective (or partial) hydration solves this by only hydrating the components that actually need JavaScript on the client. Astro pioneered this with its “islands architecture,” where each interactive component is an island that hydrates independently. The static content around it ships as plain HTML with zero JavaScript cost.

If you are committed to Next.js or Nuxt, you have options. React Server Components (RSC) in Next.js 13+ let you mark components as server-only by default. Only components with the "use client" directive ship JavaScript to the browser. Nuxt 3 supports a similar pattern with its server components. The key discipline is treating client-side interactivity as an explicit opt-in, not a default.

On one recent rebuild, moving a marketing site’s static content sections to server components and hydrating only the nav, the form, and the cookie banner reduced TBT from 1,400 ms to 280 ms on a simulated mid-range device.

For sites already live on a fully client-hydrated framework, a pragmatic middle step is “progressive hydration”: hydrate above-the-fold interactive components immediately, and defer hydration of below-the-fold components until they enter the viewport. Libraries like react-lazy-hydration make this possible without a full architectural migration.

Putting it together: a post-rebuild TTI checklist

After applying these strategies, validate the results in the same environments you measured initially. Here is a condensed checklist:

  • Route-level bundle under 50 kB gzipped (excluding framework runtime).
  • No individual long task exceeding 50 ms on a 4x CPU-throttled trace.
  • TBT under 300 ms in Lighthouse CI on a simulated mid-range device.
  • Third-party scripts deferred behind idle or interaction triggers.
  • Below-the-fold components lazy loaded via Intersection Observer.
  • Static content rendered as server components or excluded from hydration.
  • Field INP at the 75th percentile under 200 ms, verified in CrUX or your RUM tool.

If your site speed optimization work hits all seven, your TTI is under budget. If it does not, the DevTools Performance panel will show you exactly which long task is the holdout. Fix the top offender, redeploy, and measure again.

Also worth noting: layout instability caused by late-loading components can create a perceived interactivity problem even when TTI is technically fine. If a user taps a button and the target shifts because a lazy-loaded element just pushed the layout, the experience feels broken. Pair your TTI work with CLS fixes to avoid trading one problem for another.

The fastest JavaScript is the JavaScript you do not ship. Every strategy here, splitting, deferring, selectively hydrating, is a variation of that principle. Start by measuring where your main thread time actually goes, then remove the code your visitor does not need for their first interaction.

FAQs

Is TTI still a relevant metric if Lighthouse deprecated it?

Yes. Lighthouse removed TTI from its weighted score, but the underlying problem (long tasks blocking the main thread) is now captured by Total Blocking Time in lab tests and Interaction to Next Paint in field data. If your TBT or INP numbers are poor, you have the same issue TTI was designed to surface.

How small should my initial JavaScript bundle be for a marketing page?

Aim for under 50 kB gzipped for the route-specific code, excluding the framework runtime. The framework runtime itself (React, Vue, Svelte) adds another 30 to 80 kB depending on the library. If your total initial JavaScript exceeds 150 kB gzipped, investigate which dependencies are being bundled into the critical path.

What is the difference between lazy loading and selective hydration?

Lazy loading defers the download and execution of a JavaScript chunk until it is needed, typically when a component scrolls into view. Selective hydration is about whether a component receives client-side JavaScript at all. A statically rendered testimonial block might never need hydration. A form component needs hydration but can be lazy loaded if it is below the fold.

Can I apply these strategies to a site built on WordPress or a traditional CMS?

Bundle splitting and selective hydration are framework-specific concepts (React, Vue, Astro). On WordPress, the equivalent levers are deferring and async-loading plugin scripts, lazy loading images and embeds natively, and removing unused JavaScript from enqueued assets. The principles are the same: reduce main-thread work during initial load.

How do third-party scripts affect TTI?

Third-party scripts like analytics, A/B testing SDKs, and chat widgets often execute synchronously on page load, adding long tasks to the main thread. A single tag manager firing five tags can add 500 ms or more of blocking time. Defer non-critical third-party scripts behind requestIdleCallback or load them only after a user interaction to keep them off the critical path.

Ship less JavaScript, convert more visitors

The bundle splitting, lazy loading, and hydration strategies in this article only work when measured against your real traffic. We run TTI audits and implement performance fixes that bring your site under budget.

Talk to a performance engineer