---
title: Optimizations
description: Optimize your Next.js application for best performance and user experience.
url: "https://nextjs.org/docs/13/pages/building-your-application/optimizing"
docs_index: /docs/13/pages/llms.txt
lastUpdated: 2023-06-28
navTitle: "Optimizing"
prerequisites:
  - "Building Your Application: /docs/13/pages/building-your-application"
---

> For an index of all documentation, see [/docs/13/pages/llms.txt](/docs/13/pages/llms.txt).

Next.js comes with a variety of built-in optimizations designed to improve your application's speed and [Core Web Vitals](https://web.dev/vitals/). This guide will cover the optimizations you can leverage to enhance your user experience.

## Built-in Components

Built-in components abstract away the complexity of implementing common UI optimizations. These components are:

- **Images**: Built on the native `<img>` element. The Image Component optimizes images for performance by lazy loading and automatically resizing images based on device size.
- **Link**: Built on the native `<a>` tags. The Link Component prefetches pages in the background, for faster and smoother page transitions.
- **Scripts**: Built on the native `<script>` tags. The Script Component gives you control over loading and execution of third-party scripts.

## Metadata

Metadata helps search engines understand your content better (which can result in better SEO), and allows you to customize how your content is presented on social media, helping you create a more engaging and consistent user experience across various platforms.

The Head Component in Next.js allows you to modify the `<head>` of a page. Learn more in the [Head Component](/docs/pages/api-reference/components/head) documentation.

## Static Assets

Next.js `/public` folder can be used to serve static assets like images, fonts, and other files. Files inside `/public` can also be cached by CDN providers so that they are delivered efficiently.

## Analytics and Monitoring

For large applications, Next.js integrates with popular analytics and monitoring tools to help you understand how your application is performing. Learn more in the [Analytics](/docs/app/building-your-application/optimizing/analytics),  [OpenTelemetry](/docs/pages/building-your-application/optimizing/open-telemetry), and [Instrumentation](/docs/pages/building-your-application/optimizing/instrumentation) guides.

- [Images](/docs/13/pages/building-your-application/optimizing/images): Optimize your images with the built-in \`next/image\` component.
- [Fonts](/docs/13/pages/building-your-application/optimizing/fonts): Optimize your application's web fonts with the built-in \`next/font\` loaders.
- [Scripts](/docs/13/pages/building-your-application/optimizing/scripts): Optimize 3rd party scripts with the built-in Script component.
- [Static Assets](/docs/13/pages/building-your-application/optimizing/static-assets): Next.js allows you to serve static files, like images, in the public directory. You can learn how it works here.
- [Lazy Loading](/docs/13/pages/building-your-application/optimizing/lazy-loading): Lazy load imported libraries and React Components to improve your application's loading performance.
- [Analytics](/docs/13/pages/building-your-application/optimizing/analytics): Measure and track page performance using Next.js Speed Insights
- [OpenTelemetry](/docs/13/pages/building-your-application/optimizing/open-telemetry): Learn how to instrument your Next.js app with OpenTelemetry.
- [Instrumentation](/docs/13/pages/building-your-application/optimizing/instrumentation): Learn how to use instrumentation to run code at server startup in your Next.js app
- [Testing](/docs/13/pages/building-your-application/optimizing/testing): Learn how to set up Next.js with three commonly used testing tools — Cypress, Playwright, Jest, and React Testing Library.

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/docs/13/pages/llms.txt](/docs/13/pages/llms.txt)