-
Notifications
You must be signed in to change notification settings - Fork 86
feat: use edge functions for content negotiation by default #1438
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
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-rsc-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
dc0b64c
to
49a03ac
Compare
49a03ac
to
dab9985
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. On first load, the Canary demo showed a broken image, but on refresh it did load. Not sure if this is related to this PR, or just a fluke.
Was probably AVIF timing-out. Let's see how it gets on in the wild. We may need to disable it, if it fails too much. |
Summary
This PR enables content negotiation for images using edge functions to be opt-out, rather than opt-in. The PR ensures that the old redirect is also written, but it will not match if the edge function runs.
This PR also ensures that the edge function respects the Next image formats config option, which means that by default webp is the only modern format offered, but that AVIF is an option.
The PR adds some docs on the behaviour, as well as some general information about image handling. I rearranged some of the docs to adjust priorities.
@KyleBlankRollins This adds a new env var:
NEXT_DISABLE_EDGE_IMAGES
, which disables the edge fucntion used for content negotiation and instead always serves the fallback format (jpg or png)Test plan
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Fixes #1374. Fixes #1437

Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.