How does Layer0 provide the ISR feature of nextjs?

How does Layer0 provide the ISR feature of nextjs?

Is the generated page deployed to a S3?

Does a Lambda function update the file when a TTL expires?

At the 20min mark of this video, is a high level description of how ISR/ISG is works in general: The Evolution of Jamstack /

For the current Layer0 implementation, the generated page is stored in the Edge and available to all Edge nodes. It is not currently saved to S3.

If a request comes in after the TTL but before the grace period, then the edge will serve the stale data and simultaneously the lambda will regenerate the page for the next visitor. The system will not proactively regenerate the page when a TTL expires if there are no requests for it.

@ianand , great explanation about Jamstack. But something still fuzzy to me.
As you explained in the video, with this approach the boundaries between the app/server and the edge starts to be blurry.

As I understood, Nextjs has ISR in its core. It means that even without a CDN the ISR will work.
This is true because nextjs generates static files of dynamic pages and has the logic to control when a new file should be generated.

When you add the cnd in front of a NextJs Application you have this second cache that lives in the Edge.

How Layer0 sync both caches and what will happen when the edge cache expires?

For example:
1 - Dynamic page that has no cache yet receive a request.
2 - Nextjs will generate a file (Where this file is generated?)
3 - The edge will cache the nextjs response and deliver it to the client4 - A new request come in after the time specified in the revalidate prop returned by getStaticProps function in Nextjs.
5 - Does Layer0 has this revalidate time as max-age too? Let’s say yes. Will Layer0 deliver the stale content and trigger nextjs function (lambda) to generate the new static file? If yes, it means that nextjs will also deliver the stale file and generate a new one, but Layer0 will cache the stale file again.

I need to figure out this, to have a better understand about how long will take to the updated content be available and based on that define the revalidate time.