Next.js Discord

Discord Forum

staticpath generation outside of build time

Unanswered
New Zealand posted this in #help-forum
Open in Discord
New ZealandOP
Help! I'm trying to implement static paths in my project, I have around 1500 pages to generate, it's taking too long to run on build time (40 minutes) from a 5 minute build, this is unacceptable at the rate our team is moving on, so I'm looking for an alternative.

What I'm thinking is exposing and endpoint that gets all the paths we want to prerender and then runs res.revalidate() on all the paths, will this have the same effect as running getStaticPaths on build?

Apart from the fact that the prerendered pages will not be cached precisely when deployed, but a couple of minutes after.

Any ideas?

0 Replies