Thoughts on Implementing ISR like Next JS #228
Replies: 8 comments 9 replies
-
And please make it compatible with all Hosts 🥺 |
Beta Was this translation helpful? Give feedback.
-
Astro currently has a feature called "hybrid rendering" which lets you mix static, pre-rendered content with dynamic rendered-on-demand content. You can configure the length of time that a response is cached in your CDN via the |
Beta Was this translation helpful? Give feedback.
-
Would recommend this video for anyone who wants to deep dive into understanding the different cache headers and how ISR can be implemented via CDN + cache headers |
Beta Was this translation helpful? Give feedback.
-
ISR is going to require different approaches that depend on where you are deploying. I am working on a guide for the docs site that you can track here: withastro/docs#3527 (rendered preview). Please share how you plan to use ISR and where you deploy so I can better document it. |
Beta Was this translation helpful? Give feedback.
-
The vercel adapter now supports Vercel's implementation of ISR. @astrojs/vercel | Astro Docs. Netlify's equivalent is called On-Demand Builders, and is usable in version 3.1.1 of the official adapter. The current iteration (v4, v5) offers automatic caching that uses standard Cloudflare has the infrastructure to offer an equivalent in Cache Reserve, but it is not hooked up to the imperative Cache API available in workers. Your only option is per-region and temporary caching. For self-hosting, the specifics will depend on the exact set of reverse proxies you are using, but the idea will be to make them save cached responses in object storage. |
Beta Was this translation helpful? Give feedback.
-
Looks like this issue has been resolved! We now support adapter-level config for ISR on major platforms that support it, notably Vercel and Netlify. Try it out and feel free to open further discussion for features you'd like to see. |
Beta Was this translation helpful? Give feedback.
-
I am curious, if both @astrojs/vercel | Astro Docs and On-Demand Builders will work with the Server Island ?? if so it would nice to documented (I can if someone can confirm). |
Beta Was this translation helpful? Give feedback.
-
Awesome that Astro is getting ISR! This seems like the final steps from leaving frustrating Next.js for Astro, but on demand revalidation when? :D Mostly via cache tags would be great. |
Beta Was this translation helpful? Give feedback.
-
I think for real time news sites and similar that want the performance of SSG without having to rebuild the entire site on every update, this is incredible.
I don't see support in the roadmap but curious if it's on the team's radar by any chance ?
https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration
Beta Was this translation helpful? Give feedback.
All reactions