logo
  • Guide
  • Config
  • Plugin
  • API
  • Examples
  • Community
  • Modern.js 2.x Docs
  • English
    • 简体中文
    • English
    • Start
      Introduction
      Quick Start
      Upgrading
      Glossary
      Tech Stack
      Core Concept
      Page Entry
      Build Engine
      Web Server
      Basic Features
      Routes
      Routing
      Config Routes
      Data Solution
      Data Fetching
      Data Writing
      Data Caching
      Rendering
      Rendering Mode Overview
      Server-Side Rendering
      Streaming Server-Side Rendering
      Rendering Cache
      Static Site Generation
      React Server Components (RSC)
      Render Preprocessing
      Styling
      Styling
      Use CSS Modules
      Using CSS-in-JS
      Using Tailwind CSS
      HTML Template
      Import Static Assets
      Import JSON Files
      Import SVG Assets
      Import Wasm Assets
      Debug
      Data Mocking
      Network Proxy
      Using Rsdoctor
      Using Storybook
      Testing
      Playwright
      Vitest
      Jest
      Cypress
      Path Alias
      Environment Variables
      Output Files
      Deploy Application
      Advanced Features
      Using Rspack
      Using BFF
      Basic Usage
      Runtime Framework
      Creating Extensible BFF Functions
      Extend BFF Server
      Extend Request SDK
      File Upload
      Cross-Project Invocation
      Optimize Page Performance
      Code Splitting
      Inline Static Assets
      Bundle Size Optimization
      React Compiler
      Improve Build Performance
      Browser Compatibility
      Low-Level Tools
      Source Code Build Mode
      Server Monitor
      Monitors
      Logs Events
      Metrics Events
      Internationalization
      Basic Concepts
      Quick Start
      Configuration
      Locale Detection
      Resource Loading
      Routing Integration
      API Reference
      Advanced Usage
      Best Practices
      Custom Web Server
      Topic Detail
      Module Federation
      Introduction
      Getting Started
      Application-Level Modules
      Server-Side Rendering
      Deployment
      Integrating Internationalization
      FAQ
      Dependencies FAQ
      CLI FAQ
      Build FAQ
      HMR FAQ
      📝 Edit this page
      Previous pageData CachingNext pageServer-Side Rendering

      #Rendering Mode Overview

      Modern.js supports multiple rendering modes, and different rendering modes are suitable for different scenarios. Choosing the right rendering mode can significantly improve application performance and user experience.

      #Rendering Mode Quick Reference

      Rendering ModeCharacteristicsUse Cases
      CSRExecutes JavaScript in the browser to render pagesApplications with strong interactivity and low SEO requirements
      SSRPre-renders complete HTML pages on the serverWebsites with high requirements for first-screen performance and SEO
      Streaming SSRRenders and returns progressively, displaying initial UI fasterApplications requiring faster first-screen perception speed (Default SSR mode)
      RSCComponents render on the server, reducing client JS size; high cohesion between data and component logic, reducing state passingProjects pursuing optimal performance and needing to reduce client-side code
      SSGGenerates static pages at build time, can be cached by CDNWebsites with relatively static content, such as blogs and documentation sites

      #Performance Comparison

      Rendering TechnologyCore AdvantagesMain Bottlenecks
      SSRServer-side pre-rendering, beneficial for SEOMust wait for all data to load before responding
      Streaming SSRRenders and returns progressively, faster first screenJS bundle size is still large
      Streaming SSR + RSCReduces client JS size-

      #How to Choose

      #Quick Decision Guide

      • Static Content + SEO Required → SSG
      • SEO Required + First Screen Performance → Streaming SSR (default)
      • Pursuing Optimal Performance → Streaming SSR + RSC
      • CSR Project Gradual Optimization → CSR + RSC
      • Highly Interactive + No SEO Needed → CSR

      #Combining Modes

      Modern.js supports combining multiple rendering modes:

      • Streaming SSR + RSC: Streaming rendering + reduced client-side code
      • SSG + SSR: Some pages static, some pages dynamic
      • CSR + RSC: Client-side rendering + partial Server Components

      #Related Documentation

      • Server-Side Rendering (SSR)
      • Streaming Server-Side Rendering (Streaming SSR)
      • React Server Components (RSC)
      • Static Site Generation (SSG)
      • Rendering Cache