What is Prerendering?
devPrerendering is a technique to gain the benefits of Server-Side Rendering (SSR) without the complexity. It works by launching a headless browser, loading your application's routes, and saving the resulting state as static HTML files. These files can then be served by any static file server.
When to use Prerendering:
- When you want fast, static delivery of SPA routes.
- When you want to avoid the implementation overhead of full SSR.
When to avoid Prerendering:
- High route volume: If you have thousands of routes, the build process will be slow.
- Highly dynamic content: If content is user-specific, ensure you use placeholder components that load on the client-side to avoid showing incorrect static data.