Skip to content

Conversation

@orinokai
Copy link
Contributor

@orinokai orinokai commented Feb 23, 2023

Proof-of-concept that demonstrates how we might intercept a call to res.revalidate() from within a Next.js API function.

The res.revalidate() function creates a mock request, with an x-prerender-revalidate header and calls the NextServer request handler directly. There is no new network request so we cannot intercept the call directly in our handler function. Instead, we can subclass NextServer with our own implementation that overrides getRequestHandler to return a custom handler that listens for the x-prerender-revalidate header.

You can test this by hitting the revalidate API function and checking the function logs for 'Revalidate request'
https://deploy-preview-1937--netlify-plugin-nextjs-demo.netlify.app/api/revalidate/

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/63ff1a046fb07100080dab4e
😎 Deploy Preview https://deploy-preview-1937--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/63ff1a04e4a871000899c5e9
😎 Deploy Preview https://deploy-preview-1937--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Feb 23, 2023
@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63ff1a049f2b1b00087d6a65
😎 Deploy Preview https://deploy-preview-1937--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63ff1a04c84e830008aa6c65
😎 Deploy Preview https://deploy-preview-1937--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63ff1a046a69b80008ad6110
😎 Deploy Preview https://deploy-preview-1937--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63ff1a040deb470008a3e429
😎 Deploy Preview https://deploy-preview-1937--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63ff1a0456c43600083150d7
😎 Deploy Preview https://deploy-preview-1937--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63ff1a04ee86320008f57100
😎 Deploy Preview https://deploy-preview-1937--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 8033d60
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63ff1a04d271340008273082
😎 Deploy Preview https://deploy-preview-1937--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

renovate bot and others added 9 commits February 23, 2023 19:05
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature code contributing to the implementation of a feature and/or user facing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants