Static Reactions Demo

Reactions on this GitHub issue:

๐Ÿ‘ 135
๐Ÿ‘Ž 0
๐Ÿ˜„ 36
๐ŸŽ‰ 36
๐Ÿ˜• 9
๐Ÿงก 38
๐Ÿš€ 41
๐Ÿ‘€ 45

Explanation: This page is statically generated with Next.js by fetching data from GitHub. Itโ€™s deployed to Vercelโ€™s Edge Network (CDN). Importantly, this page is being regenerated using Incremental Static Regeneration (beta feature in Next.js 9.4). Hereโ€™s how it works:
  1. Each Next.js page can define the timeout. For this page, itโ€™s set at 1 second.
  2. When a new request comes in, the statically generated page is served.
  3. Later, when another request comes in after the defined timeout is exceeded: (1) The statically generated page is served, and (2) Next.js generates a new version of the page in the background and updates the static page for *future* requests.
  4. Later, when another request comes in after the regeneration is done: The updated static page is served.
  5. This allows Incremental Static Regeneration on a per-page basis without rebuilding the full app. Itโ€™ll always be fast because users will always get a static response. Learn more here.
Source: pages/index.js - `getStaticProps()` fetches the data during static generation, and `unstable_revalidate` specifies the timeout.