-
Notifications
You must be signed in to change notification settings - Fork 29.9k
docs: add example for enabling both AVIF and WebP image formats for better image optimization #86191
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
Merged
icyJoseph
merged 11 commits into
vercel:canary
from
KaziMahbuburRahman:docs/add-avif-webp-formats-example
Nov 20, 2025
Merged
docs: add example for enabling both AVIF and WebP image formats for better image optimization #86191
icyJoseph
merged 11 commits into
vercel:canary
from
KaziMahbuburRahman:docs/add-avif-webp-formats-example
Nov 20, 2025
+22
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… WebP formats. Added configuration examples and clarified caching behavior for multiple formats.
Member
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
icyJoseph
reviewed
Nov 17, 2025
icyJoseph
reviewed
Nov 17, 2025
- Add note about cache overhead when using multiple formats - Remove redundant note about array order (already mentioned earlier) Addresses feedback about documenting increased storage requirements when enabling both AVIF and WebP formats, and removes duplicate information about format order.
…om/KaziMahbuburRahman/next.js into docs/add-avif-webp-formats-example
…om/KaziMahbuburRahman/next.js into docs/add-avif-webp-formats-example
icyJoseph
reviewed
Nov 19, 2025
icyJoseph
approved these changes
Nov 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Documentation
Related to Next.js' official documentation.
examples
Issue was opened via the examples template.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title
docs: add example for enabling both AVIF and WebP image formats
Description
What?
This PR enhances the image component documentation by adding examples showing how to enable both AVIF and WebP image formats together in
next.config.js. It also updates theimage-componentexample to demonstrate this configuration.Why?
Currently, the documentation only shows examples for:
formats: ['image/webp']formats: ['image/avif']However, many developers want to enable both formats together to:
This configuration is a best practice but wasn't clearly documented with an example.
How?
formats: ['image/avif', 'image/webp']to App Router image component documentationexamples/image-component/next.config.jsto demonstrate the configurationChanges Made
docs/01-app/03-api-reference/02-components/image.mdx- Added AVIF + WebP exampledocs/02-pages/04-api-reference/01-components/image-legacy.mdx- Added AVIF + WebP exampleexamples/image-component/next.config.js- Added formats configurationTesting
Checklist
pnpm prettier-fixto fix formatting issues (if applicable)