Static Export with ISR
Answered
Cyanide posted this in #help-forum
CyanideOP
Hi! We have a NextJS Router static app i.e with
We want to use this in accordance with S3 like maybe Cache is somewhere and serve the static site? This seems to be a common use case. Can anyone help with this?
output: export mode here we have many micro pages which are indepdent and this build time is quite high. Can we use some sort of ISR technique such that we only build only those pages which are changed. Say I modify in /site/examples/2 so only that bundle gets changed. Say, I changed in utils file which was used by all so all paths get rebuild?We want to use this in accordance with S3 like maybe Cache is somewhere and serve the static site? This seems to be a common use case. Can anyone help with this?
Answered by joulev
no i dont think it is possible. nextjs doesnt have a mechanism of checking for file changes compared to past builds. for it, all builds are from a clean slate.
4 Replies
no i dont think it is possible. nextjs doesnt have a mechanism of checking for file changes compared to past builds. for it, all builds are from a clean slate.
Answer
@joulev no i dont think it is possible. nextjs doesnt have a mechanism of checking for file changes compared to past builds. for it, all builds are from a clean slate.
CyanideOP
Got it Thanks @joulev , but my only question here is if it able to do ISR then why cant here? A did a POC by restarting the server and checking for revalidation if ISR works that way. It did, whenever the site was rebuild only those pages changed which were revalidated or SSRed. However, we cant serve the site without next server right? Since it isn't a static site that way, If you get it. I mean the static assets of HTML, CSS, JS however .next has a server running as a service which we can't do for now
@Cyanide Got it Thanks <@484037068239142956> , but my only question here is if it able to do ISR then why cant here? A did a POC by restarting the server and checking for revalidation if ISR works that way. It did, whenever the site was rebuild only those pages changed which were revalidated or SSRed. However, we cant serve the site without next server right? Since it isn't a static site that way, If you get it. I mean the static assets of HTML, CSS, JS however .next has a server running as a service which we can't do for now
It’s theoretically possible. Just not implemented. The build process doesn’t care if you already have an out folder containing the artefacts of a previous build. It works the same way with or without an out folder.