next-runtime
next-runtime copied to clipboard
feat: cdn cache control support
Description
This explores using CDN Cache Control headers in next-runtime. Those are alternative to ODBs. This Pull Request contains changes from following PRs:
- fix: add text/x-component header to .rsc assets generated at build time, don't use rsc-data edge function when hitting .rsc path directly
- test: setup cypress test running for variant of default demo with all flags enabled
So it might be worth checking only last commit in this PR for just CDN Cache Control related changes
Things that are done here:
- introduction of feature flag for cdn cache control
- if that flag is enabled:
- don't generate ODB handler at all, and all rewrites that previously would point to odb now point to ssr handler as it handle both SSR and ISR pages in this setup
- setting up
netlify-cdn-cache-controlheader to re-use value ofcache-controlheader provided by Next.js, settingx-nf-varyfromvaryheader provided by Next.js (syntax of value of those headers is different, so there is some manipulation of value going on) rsc-datamiddleware is no longer used for RSC request if it is handled by lambda (we still need it for .rsc files that are produced at build time - we would need header conditions for rewrites to be able to get rid of it completely)
Things not yet done:
- testing behavior related to i18n
- implementation of on-demand isr revalidation (required APIs are not yet available)
Documentation
Tests
You can test this change yourself like so:
- TODO
Relevant links (GitHub issues, etc.) or a picture of cute animal
Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6503fed35dc9ed0008764e82 |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-static-root-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for next-plugin-edge-middleware ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6503fed472b71f0007c14fa2 |
| Deploy Preview | https://deploy-preview-2286--next-plugin-edge-middleware.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for netlify-plugin-nextjs-export-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6503fed44018c30008b2731e |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-export-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6503fed38db5270008c14a14 |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6503fed4e1b6290008bea9dc |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-next-auth-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for nextjs-plugin-custom-routes-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6503fed4a5970a00086ae079 |
| Deploy Preview | https://deploy-preview-2286--nextjs-plugin-custom-routes-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for next-i18next-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/next-i18next-demo/deploys/6503fed42ff91b00081fa2e7 |
| Deploy Preview | https://deploy-preview-2286--next-i18next-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for next-plugin-canary ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/next-plugin-canary/deploys/6503fed48db5270008c14a1a |
| Deploy Preview | https://deploy-preview-2286--next-plugin-canary.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for netlify-plugin-nextjs-demo ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6503fed472b71f0007c14fa7 |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for netlify-plugin-nextjs-demo-all-flags ready!
| Name | Link |
|---|---|
| Latest commit | 5afb8096d8be9069ba4218606721ae50da70e3ed |
| Latest deploy log | https://app.netlify.com/sites/netlify-plugin-nextjs-demo-all-flags/deploys/6503fed4a7b09d0008ca6152 |
| Deploy Preview | https://deploy-preview-2286--netlify-plugin-nextjs-demo-all-flags.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Superseded by v5.