Replies: 5 comments 3 replies
-
I agree. It would be great! F.e. pages are pre-generated for DEV environment. Why it is "forced" to rebuild the app for STAGE and PROD separately (also multiple languages - per domain)? Or is it possible somehow at this time? |
Beta Was this translation helpful? Give feedback.
-
My use case is that there are thousands of pages stored in the database and would like to generate static version when they are requested. Because during build time, the compile time would be very long to compile thousands of pages. Is this the same feature requested? |
Beta Was this translation helpful? Give feedback.
-
I'd also like this feature. In our deployment system, our environment variables are injected at runtime, so any page generated with getStaticProps at build time will not have the right environment variables. Ideally, in my case, there would be a way to request a build on the first request during runtime and then all subsequent requests could be cached. At the moment, putting 1 second under the "revalidate" option is a kind of solution for us and a bad one. It defeats the purpose of static generation. |
Beta Was this translation helpful? Give feedback.
-
+1,my css file is generated at runtime |
Beta Was this translation helpful? Give feedback.
-
+1 in case of websites with thousands rarely accessed pages |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
Add support for generating static pages (without slug) on demand = at runtime (not only at build time).
Currently NextJS support generation on demand only for pages which implements
getStaticPaths
(page with slug). But static page without slug (like "pages/index.js" for homepage, "404.js", etc.) cannot implementgetStaticPaths
, so they need to be generated at build time. But in many cases this is not enough. For example when you need to support multiple instances of NexJS application and each instance has its own endpoints for data, cms etc. In this case you cannot fetch data ingetStaticProps
at build time, it's necessary to pre-generate pages at runtime in each instance.Beta Was this translation helpful? Give feedback.
All reactions