# Web Performance and Core Web Vitals

> Measure and improve load speed and responsiveness with Core Web Vitals, smaller bundles, image optimisation and caching. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/full-stack/web-performance
Last updated: 2026-11-28

Measure and improve load speed and responsiveness with Core Web Vitals, smaller bundles, image optimisation and caching.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Rendering Strategies, Metadata and SEO](https://www.internhack.in/roadmaps/tracks/full-stack/rendering-and-seo)

Many of your users are on mid-range Android phones and patchy 4G. Performance is a feature, and Google uses Core Web Vitals in search ranking.

### Core Web Vitals

- **LCP** (Largest Contentful Paint): how fast the main content appears. Aim for under 2.5 seconds.
- **INP** (Interaction to Next Paint): how quickly the page responds to taps and clicks.
- **CLS** (Cumulative Layout Shift): how much the layout jumps around while loading.

### Measuring

Use **Lighthouse** and PageSpeed Insights for lab data, and real user monitoring (Vercel Analytics or the web-vitals library) for field data. Always test with mobile throttling.

### Common fixes

- Ship less JavaScript: keep components on the server, lazy-load heavy client widgets, and check bundle size before adding libraries.
- Optimise images with next/image, modern formats and correct sizes.
- Load fonts with next/font to avoid layout shift.
- Set width and height (or aspect ratio) on media to prevent CLS.
- Cache static assets aggressively and API responses where safe.
- Fix slow backend queries; a fast frontend cannot hide a 3-second API.

### Pitfalls

- Optimising only on a fast laptop with good Wi-Fi.
- Adding a large charting or date library for one small feature.
- Chasing a perfect Lighthouse score instead of real user metrics.

You are ready to move on when your public pages hit good Core Web Vitals on a throttled mobile profile, and you can explain the biggest improvement you made and why it worked.

## Key concepts

- **LCP, INP and CLS**
- **Lighthouse and PageSpeed Insights**
- **Real user monitoring**
- **Bundle size and code splitting**
- **Image and font optimisation**
- **HTTP caching**
- **Bundle analyzer**

## Mini project

Run Lighthouse on your portal with mobile throttling, fix the top three issues (images, JavaScript size, layout shift), and publish a before and after report in the README.

## Check yourself

Your LCP is 5 seconds on mobile. Name three likely causes and how you would confirm each.

## Free resources

- [Web Vitals](https://web.dev/articles/vitals) (web.dev)
- [Learn Performance](https://web.dev/learn/performance) (web.dev)
- [Lighthouse overview](https://developer.chrome.com/docs/lighthouse/overview) (Chrome for Developers)

Previous: [Logging, Error Tracking and Monitoring](https://www.internhack.in/roadmaps/tracks/full-stack/logging-and-monitoring) · Next: [File Uploads and Object Storage](https://www.internhack.in/roadmaps/tracks/full-stack/file-uploads)

## More in CI, Observability and Performance

- [CI/CD with GitHub Actions](https://www.internhack.in/roadmaps/tracks/full-stack/ci-cd)
- [Logging, Error Tracking and Monitoring](https://www.internhack.in/roadmaps/tracks/full-stack/logging-and-monitoring)
- [Web Performance and Core Web Vitals](https://www.internhack.in/roadmaps/tracks/full-stack/web-performance)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Full-Stack Developer Roadmap](https://www.internhack.in/roadmaps/tracks/full-stack)
