Statically generated dynamic routes #13855
Replies: 1 comment
-
I am not sure I understand your question correctly, but as far as I know fallback only renders the page the fallback is triggered on it does not trigger a rebuild of the whole site. For example I created a little polling site. When you create a poll, it will trigger a client side push to your specific poll, causing the fallback to be generated, which sadly is not super fast but you can prefetch the skeleton page and as soon as the fallback is generated the page is super fast for people filling out the poll. With #11552 you will also be able to rerender the fallback. You can check the site out here https://poll.enricoschaaf.com and the code here https://github.com/enricoschaaf/poll. Hope it helps🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create a live streaming application where each route is served as stream/[id]
If I use SSG, when the user creates a stream, I can populate that stream using a fallback and serving the data inside the staticProps. My question is, what happens next, in terms of building the path? Does the site rebuild and add the path? This paragraph below is a little ambiguous.
Instead, you may statically generate a small subset of pages and use fallback: true for the rest. When someone requests a page that’s not generated yet, the user will see the page with a loading indicator. Shortly after, getStaticProps finishes and the page will be rendered with the requested data.
From now on, everyone who requests the same page will get the statically pre-rendered page.
This ensures that users always have a fast experience while preserving fast builds and the benefits of Static Generation.
The overarching question is this: if any of my pages are user generated, can I use the static method? Or am I forced to render server side?
Beta Was this translation helpful? Give feedback.
All reactions