Skip to content

COVID-19 Dashboard (Dutch) #13407

Answered by lfades
jvink asked this question in Show and tell
Discussion options

You must be logged in to vote

SSG is an excellent choice here, take a look into the RFC for Incremental Static Regeneration. If the data gets updated once per day, or every 30 minutes, or every second, doesn't matter; you can revalidate the page in the background after X amount of time and start shipping the latest HTML after that.

For example, to revalidate the page every hour:

export async function getStaticProps() {
  // ...
  return {
    props: {...},
    unstable_revalidate: 3600 // 3600 seconds = 1 hour
  }
}

The unstable_revalidate option will be shipped soon and it's safe to use it now 👍 - once it's out it will be renamed to revalidate

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jvink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants