Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docs: Image Optimization Deep Dive #78857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

delbaoliveira
Copy link
Contributor

Deep dive on how image optimization works in Next.js

Closes: https://linear.app/vercel/issue/DOC-4634/new-page-how-image-optimization-works-in-nextjs

@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

Hi there 👋

It looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:

Broken link Type File
/docs/app/api-reference/components/image#width-and-height hash /docs/01-app/04-deep-dive/image-optimization.mdx
/docs/app/api-reference/components/image#width-and-height hash /docs/01-app/04-deep-dive/image-optimization.mdx
/docs/app/api-reference/components/image#minimum-cache-ttl hash /docs/01-app/04-deep-dive/image-optimization.mdx

Thank you 🙏


### Duration

TODO: What is the default duration with no configuration?
Copy link
Contributor Author

@delbaoliveira delbaoliveira May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default cache duration if not configured?

Comment on lines +61 to +62
- [Caches](#caching-and-revalidating-images) the optimized image.
- Serves the optimized images at runtime.
Copy link
Contributor Author

@delbaoliveira delbaoliveira May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the images cached and served from?

On vercel vs. self-hosting

Comment on lines +40 to +48
### Supported image formats

The built-in loader supports common web-friendly formats:

- `jpeg`
- `png`
- `webp`
- `avif`
- `tiff`
Copy link
Contributor Author

@delbaoliveira delbaoliveira May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm supported vs. unsupported image formats

Comment on lines +59 to +62
- Generates multiple [image sizes](#image-sizing) for different screens using modern [image formats](#supported-image-formats).
- Builds the URLs pointing to the optimized image version, and creates a `srcset` attribute.
- [Caches](#caching-and-revalidating-images) the optimized image.
- Serves the optimized images at runtime.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, these steps should be sequential

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants