Server-Side Rendering (SSR / SSG)

Nijor features an integrated rendering mode labeled as Server-Side Rendering (SSR). In practice, its behavior aligns closely with Static Site Generation (SSG).

Instead of executing components on a server for every incoming request—which introduces computational cost and latency—Nijor pre-compiles and generates static HTML files during the build pipeline. These files are optimized, lightweight, and ready to be served directly from any global CDN or static file hosting service.

Enabling Static Rendering Mode

You can enable this high-performance static generation mode inside your project's nijor.config.js file by updating the build mode configuration:


        export const build = {
            mode: "ssr"
        };
    

How It Works Under the Hood

This static architecture is a deliberate performance choice. By pre-building raw HTML ahead of time, Nijor ensures that search engine web crawlers receive fully structured content instantly (improving SEO), and end-users experience near-instant initial page load times.

Once the pre-rendered HTML file is loaded in the visitor's browser, client-side scripts execute to restore dynamic interactivity, enabling a highly responsive single-page experience.

Important Build Limitations

Production Only: Static generation (SSR/SSG) runs exclusively during the production compilation phase (nijor build). It is deactivated during local development (nijor dev) to preserve rapid hot-reloading speeds, as compiling the entire site to static files on every file save would introduce unnecessary development overhead.

Hydration & Development Status

Nijor's client-side hydration engine is actively evolving. While pre-built HTML renders correctly on initial load, fully synchronizing client-side state without re-running component bootstrapping is still being optimized.

As a temporary workaround, components may execute their logic again upon page load. This can occasionally lead to redundant rendering cycles, but ensures complete client-side functionality. Optimizing hydration to eliminate these redundant runs is a major item on our roadmap.