GetStaticPaths for ISR #125
-
Hey everyone, As far as I understand if I want to support multi-tenancy for my app with ISR I need to use getStaticPaths with getStaticProps. Where the getStaticPaths basically knows all of the sub-domains that I want to support and pre-renders them at build time. My only problem with this is that in the docs for getStaticPaths it says getStaticPaths will only run during build in production, it will not be called during runtime. So how would I then be able to add new subdomain pages (i.e. when a new user registers) without re-deploying the whole application? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey! All you need to do is use |
Beta Was this translation helpful? Give feedback.
Hey! All you need to do is use
getStaticProps
withrevalidate
prop andfallback: true
orfallback: "blocking"
in yourgetStaticPaths
. You can read more on how to do that here: https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration