0
Follow
2
View

Need to redeploy on Vercel after creating data on strapi backend [duplicate]

dgzhengming 注册会员
2023-01-25 11:01

That can be achieved with getStaticProps/getStaticPaths. You'll have to use fallback: true or fallback: 'blocking' in getStaticPaths.

With fallback: true the paths not generated at build time will serve a fallback page on the first request while Next.js statically generates the page. When this is done the page will be swapped from the fallback page to the actual full page.

With fallback: 'blocking', the paths not generated at build time will wait for the HTML to be generated by Next.js, then serve the page once that's done. Unlike fallback: true, since there's no fallback the rendering gets blocked until the page is generated, similar to what happens during server-side rendering.

In both cases the page gets added to the list of pre-rendered pages. Subsequent requests to the same path will serve the pre-generated page.

Neither of these options is supported by next export, in case you depend on that.


Note that revalidate is used in getStaticProps for Incremental Static Regeneration - in cases where you'd want to update existing, generated pages. Since you mentioned generated pages will never change, then there's no need to use revalidate.

About the Author

Question Info

Publish Time
2023-01-25 11:01
Update Time
2023-01-25 11:01