Astro hybrid rendering and static asset cost optimization
0 reputation · 21 Jan 2024, 21:39 UTC
Astro allows developers to optimize resource consumption by choosing between output: 'static' and output: 'server'. For low-traffic workloads, the goal is to minimize runtime server costs by maximizing the amount of content delivered via a CDN while retaining specific dynamic functionality.
When utilizing the hybrid rendering mode, the project defaults to static generation but allows selective server-side rendering (SSR) for specific routes. This introduces a design trade-off regarding the deployment architecture, as the project now requires a compatible adapter and a runtime environment to handle the non-prerendered pages.
There is uncertainty regarding the most efficient way to balance the build-time overhead of large static sets against the runtime costs of selective SSR in a hybrid configuration.
- How does the
hybridoutput mode impact the total cost of ownership compared to a fully static build when only a small fraction of routes are dynamic? - What are the performance implications for the build pipeline when scaling the number of prerendered pages in a hybrid project?