Skip to content

[build-output-api] Update On-Demand ISR example with expiration: false prerenders #374

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
merged 4 commits into from
Aug 11, 2022

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Aug 11, 2022

Description

This adds an example of expiration: false prerenders to our On-Demand ISR example as we've had some questions about handling this. This is specifically demonstrating how On-Demand ISR can be used in combination with routes to only generate paths via On-Demand ISR instead of whenever a user visits a new path.

x-ref: vercel/vercel#8289 (reply in thread)
x-ref: slack thread

Deployed example can be seen here https://boa-on-demand-fysl8lh1b-ijjk-testing.vercel.app/blog/post-1

Demo URL

Type of Change

  • New Example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

New Example Checklist

  • 🛫 npm run new-example was used to create the example
  • 📚 The template wasn't used but I carefuly read the Adding a new example steps and implemented them in the example
  • 📱 Is it responsive? Are mobile and tablets considered?

Sorry, something went wrong.

Unverified

This user has not yet uploaded their public signing key.
@ijjk ijjk requested a review from TooTallNate as a code owner August 11, 2022 04:26
@vercel
Copy link

vercel bot commented Aug 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
build-output-api-isr ✅ Ready (Inspect) Visit Preview Aug 11, 2022 at 3:40PM (UTC)
edge-ab-testing-google-optimize 🔄 Building (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-streaming-response ❌ Failed (Inspect) Aug 11, 2022 at 3:40PM (UTC)
67 Ignored Deployments
Name Status Preview Updated
build-output-api-edge-functions ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-edge-middleware ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-image-optimization ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-overrides ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-prerender-functions ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-preview-mode ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-routes ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-serverless-functions ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-static-files ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
build-output-api-wildcard ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
domains-api ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-ab-testing-statsig ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-api-routes-cache-control ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-api-routes-hello-world ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-api-routes-json-response ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-api-routes-query-parameters ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-ab-testing-simple ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-add-header ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-api-rate-limit ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-api-rate-limit-and-tokens ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-authed-proxy ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-basic-auth-password ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-bot-protection-botd ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-bot-protection-datadome ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-cookies ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-cors ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-crypto ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-feature-flag-configcat ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-feature-flag-posthog ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-feature-flag-split ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-geolocation ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-hostname-rewrites ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-i18n ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-image-response ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-ip-blocking ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-ip-blocking-datadome ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-json-response ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-jwt-authentication ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-news ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-power-parity-pricing ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-power-parity-pricing-strategies ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-query-params-filter ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-functions-redirects-upstash ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-maintenance-page ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-rewrites-upstash ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
edge-user-agent-based-rendering ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
example-auth-with-ory ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
example-feature-flag-apple-store ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
example-reduce-image-bandwidth-usage ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
feature-flag-optimizely ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
i18n ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
mint-nft ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-cms-contentstack-commerce ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-combining-data-fetching-strategies ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-image-fallback ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-image-offset ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-loading-web-fonts ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-microfrontends ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-microfrontends-docs ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-monorepo ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-on-demand-isr ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-pagination-with-ssg ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-reuse-responses ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-script-component-ad ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-script-component-strategies ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
solutions-subdomains-auth ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)
static-tweets-tailwind ⬜️ Ignored (Inspect) Aug 11, 2022 at 3:40PM (UTC)

Copy link
Member

@TooTallNate TooTallNate left a comment

Choose a reason for hiding this comment

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

Nice! I left a few suggestions to simplify a bit.

There is also an example of a blog that only generates new paths when triggered via On-Demand ISR with two initial posts that are prerendered.

- `/blog/[slug]`
- base post prerender that allows generating news paths via On-Demand ISR
Copy link
Member

Choose a reason for hiding this comment

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

Is there an API endpoint to trigger this? Or should we document a fetch() call example or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can add a revalidate endpoint for this similar to the other for clarity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 1758bd1

@TooTallNate
Copy link
Member

I also wonder if we should split this into a separate example (on-demand-isg?)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Nathan Rajlich <[email protected]>
@ijjk
Copy link
Member Author

ijjk commented Aug 11, 2022

I'm not sure if we want to have a separate example for this as we've kinda sunset the ISG documentation in favor of the ISR docs to prevent confusion between the two.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
@TooTallNate TooTallNate requested a review from lfades August 11, 2022 16:39
@TooTallNate TooTallNate changed the title Update On-Demand ISR example with expiration: false prerenders [build-output-api] Update On-Demand ISR example with expiration: false prerenders Aug 11, 2022
@ijjk ijjk merged commit 7ec7e3e into main Aug 11, 2022
@ijjk ijjk deleted the add/on-demand-isg branch August 11, 2022 16:42
okbel pushed a commit that referenced this pull request Aug 16, 2022
…se` prerenders (#374)

* Update On-Demand ISR example with expiration: false prerenders

* Apply suggestions from code review

Co-authored-by: Nathan Rajlich <[email protected]>

* Add revalidate link

* fix match

Co-authored-by: Nathan Rajlich <[email protected]>
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.

None yet

2 participants