Rendering Modes
Jaspr provides three distinct rendering modes:Server-Side Rendering
Render pages dynamically on the server for each request
Client-Side Rendering
Render and hydrate components in the browser
Static Site Generation
Pre-render all pages at build time
Choosing a Rendering Mode
The rendering mode is configured in yourjaspr_options.yaml file:
Client-side rendering is automatically included when you use the
@client annotation on components, regardless of your primary rendering mode.Mode Comparison
| Feature | Server (SSR) | Static (SSG) | Client (CSR) |
|---|---|---|---|
| Build Output | Executable + static assets | HTML files + static assets | Static assets only |
| Server Required | Yes | No | No |
| Dynamic Content | Full support | Build-time only | Full support |
| SEO | Excellent | Excellent | Limited |
| Performance | Fast TTFB | Fastest TTFB | Slower TTFB |
| Scalability | Requires server resources | Highly scalable | Highly scalable |
| Use Case | Dynamic apps, APIs | Blogs, docs, marketing | SPAs, dashboards |
Server-Side Rendering (SSR)
Server-side rendering generates HTML on the server for each incoming request. This mode is ideal for:- Dynamic applications with frequently changing data
- User-specific content that varies per request
- SEO-critical pages that need fresh content
- Applications with APIs that need server-side logic
Static Site Generation (SSG)
Static site generation pre-renders all pages at build time. This mode is perfect for:- Content-heavy sites like blogs and documentation
- Marketing pages with infrequent updates
- High-traffic sites that need maximum performance
- Sites deployed to CDNs without server infrastructure
Client-Side Rendering (CSR)
Client-side rendering happens in the browser after initial page load. In Jaspr, you enable CSR for specific components using the@client annotation:
Client components are automatically hydrated when the page loads, preserving the server-rendered HTML and adding interactivity.
Hybrid Rendering
Jaspr’s unique strength is hybrid rendering - combining server and client rendering in the same application:Next Steps
Learn Server-Side Rendering
Dive deep into SSR configuration and server-specific APIsServer-Side Rendering →
Understand Client-Side Hydration
Learn how to create interactive client componentsClient-Side Rendering →
Build Static Sites
Generate fast, static sites with SSGStatic Site Generation →