What is Astro's hybrid rendering and on-demand prerendering?
Answer
Astro's hybrid rendering (output: "hybrid") allows mixing static prerendered pages with server-rendered pages in the same project. By default in hybrid mode, all pages are prerendered at build time. Opt specific pages into SSR: export const prerender = false;. The opposite in server mode: export const prerender = true; to prerender individual pages. On-demand prerendering (server islands): even in SSR mode, you can prerender stable content while injecting server-rendered islands for personalized sections. This is different from Astro's client islands (interactive JS) — server islands defer server-rendered HTML for a specific component, enabling caching of the page shell while personalizing dynamic sections. Architecture: the outer shell is static (CDN-cached), placeholders are replaced with fresh server-rendered content via separate requests. This pattern is similar to Edge Side Includes (ESI) but implemented at the framework level. Benefits: maximum CDN cache efficiency for the static shell, fresh personalized content where needed.
Previous
How does Remix handle multi-tenant applications?
Next
How does Remix optimize performance with headers and caching?
More Remix & Astro Questions
View all →- Advanced How does Remix's data flow architecture compare to traditional React apps?
- Advanced What is Astro's Islands Architecture at the technical level?
- Advanced How do you implement internationalization (i18n) in Remix?
- Advanced What are Astro's server actions (Astro Actions)?
- Advanced How does Remix handle multi-tenant applications?