Cut the time your page is unresponsive
Reduce main-thread JavaScript work so taps register immediately.
1–2 hours
why this matters
While scripts run, the browser ignores taps and clicks. Visitors read that as a broken button and tap again, or leave.
Step by step
- 1
Audit third-party tags
Chat widgets, heatmaps, ad scripts and A/B testing tools are usually the bulk of the problem. List them, delete the ones nobody looks at, and load the rest after interaction or on idle.
- 2
Defer everything non-critical
Add defer to your own scripts, and load analytics and widgets after the page is interactive.
window.addEventListener('load', () => { requestIdleCallback(() => import('./chat-widget.js')); }); - 3
Split your bundle
Load only the code the current page needs and import the rest dynamically at the point of use.
const Chart = React.lazy(() => import('./Chart')); - 4
Break up long tasks
Any single task over 50ms blocks input. Chunk heavy loops and yield to the browser between chunks.
await scheduler.yield?.() ?? new Promise((r) => setTimeout(r, 0));
how to check it worked
- Total Blocking Time under 200ms on mobile
- No long tasks over 50ms in a DevTools recording
related guides
Make your main content appear faster (LCP)
Get the largest element on screen painted within 2.5 seconds on mobile.
Stop the page jumping around (CLS)
Reserve space for everything that loads late so content never moves.
Page speed basics
The changes that improve almost every slow site, in the order worth doing them.