0
0
NextJSframework~8 mins

Intercepting routes (.) in NextJS - Performance & Optimization

Choose your learning style9 modes available
Performance: Intercepting routes (.)
MEDIUM IMPACT
This affects page load speed and interaction responsiveness by controlling how route changes load and render content.
Loading nested content without full page reload
NextJS
import Link from 'next/link';

export default function Page() {
  return <Link href="/dashboard/settings" replace>Go to Settings</Link>;
}
Intercepting route loads nested content client-side without full reload, preserving state and speeding up navigation.
📈 Performance Gainreduces load blocking to under 100ms, avoids full page reload
Loading nested content without full page reload
NextJS
export default function Page() {
  return <a href="/dashboard/settings">Go to Settings</a>;
}
This causes a full page reload and loses client-side state, increasing load time and reducing responsiveness.
📉 Performance Costblocks rendering for 200-500ms depending on network, triggers full page reload
Performance Comparison
PatternDOM OperationsReflowsPaint CostVerdict
Full page reload on route changeHigh (rebuilds entire DOM)Multiple (full layout recalculation)High (repaints entire page)[X] Bad
Intercepting nested routes with client-side navigationLow (updates partial DOM)Single or none (partial layout update)Low (partial repaint)[OK] Good
Rendering Pipeline
Intercepting routes modify the navigation flow by loading nested route segments client-side, reducing full page reloads and re-executions of server code.
Routing
Data Fetching
Rendering
Hydration
⚠️ BottleneckRouting and Data Fetching when fallback or server data is needed
Core Web Vital Affected
LCP, INP
This affects page load speed and interaction responsiveness by controlling how route changes load and render content.
Optimization Tips
1Use intercepting routes to load nested content client-side and avoid full page reloads.
2Preload nested route segments to reduce data fetching delays.
3Cache data and components to speed up repeated navigations.
Performance Quiz - 3 Questions
Test your performance knowledge
What is a main performance benefit of using intercepting routes in Next.js?
AThey avoid full page reloads by loading nested routes client-side.
BThey increase bundle size by loading all routes at once.
CThey force server-side rendering on every navigation.
DThey disable client-side caching for faster reloads.
DevTools: Performance
How to check: Record a navigation event and look for full page reloads vs partial updates in the flame chart.
What to look for: Long tasks and full page re-layouts indicate bad pattern; short tasks with partial DOM updates indicate good pattern.