Skip to content
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

[nextjs/template][sitecore-jss-nextjs] On demand ISR #1674

Merged
merged 25 commits into from
Dec 8, 2023

Conversation

addy-pathania
Copy link
Contributor

@addy-pathania addy-pathania commented Nov 22, 2023

Adds On-demand ISR feature from Nextjs

  • An API route is introduced (/api/revalidate). When triggered this will purge the updated page path on-demand
  • We have the traditional ISR(revalidate: 5s) which is enabled by default and now on-demand ISR which can be configured using a webhook.
  • Users need to pass a secret and configure their environment variable i.e. ISR_REVALIDATE_SECRET in order to prevent unauthorized user access.
  • Users need to setup a webhook to automatically trigger the API route. They need to pass the multiSite or personalize Boolean values through their webhook payload if multi-site or personalize is configured.
  • This PR follows the Contribution Guide
  • Changelog updated

Description / Motivation

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

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

I didn't have time to do a full review, but here is some preliminary feedback

@addy-pathania addy-pathania requested review from ambrauer and a team November 22, 2023 23:02
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

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

Approved by mistake, need to resolve comments first :)

addy-pathania and others added 5 commits November 24, 2023 17:28
Co-authored-by: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com>
Co-authored-by: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com>
Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

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

Just some minor things this round, conditionally approving. Nice work!

addy-pathania and others added 3 commits December 8, 2023 16:48
…i/revalidate.ts

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>
@addy-pathania addy-pathania merged commit d653d8a into dev Dec 8, 2023
@addy-pathania addy-pathania deleted the feature/jss-378-on-demand-isr branch December 8, 2023 23:10
@addy-pathania addy-pathania restored the feature/jss-378-on-demand-isr branch March 14, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants