The Spectrum of Modern Web Rendering

One of the most consequential decisions when designing a web platform is deciding where and when your HTML is generated. Choose incorrectly, and you either overwhelm your databases with unnecessary queries or deliver stale, outdated data to your visitors.

Modern full-stack frameworks provide multiple rendering strategies:

1
Static Site Generation (SSG)
2
Server-Side Rendering (SSR)
3
Incremental Static Regeneration (ISR)
4
Client-Side Rendering (CSR)

Understanding the latency, cost, and freshness tradeoffs of each model is essential for any high-scale digital product.


Strategy Comparison Matrix

StrategyWhen HTML is BuiltTTFB (Time to First Byte)Database LoadContent Freshness
SSGBuild timeInstant (~20ms from CDN Edge)Zero runtime queriesRequires build to update
ISRBuild time + Background revalidationInstant (~20ms from CDN Edge)Minimal background queriesEventually consistent
SSROn every user request150ms – 400ms (Origin dependent)High (query per request)Real-time immediate
CSRIn the user's browserFast shell, slow interactive paintDistributed API callsDependent on client network

1. Static Site Generation (SSG)

SSG compiles HTML, CSS, and data payloads ahead of time during the deployment build process. The resulting static files are distributed globally across Content Delivery Network (CDN) edge nodes.

Best Used For:

  • Marketing landing pages and agency portfolios.
  • Documentation, legal privacy policies, and terms of service.
  • Corporate about pages and public case studies.
  • tsx
    // Next.js static generation with automated prerendering
    export default async function TermsPage() {
      const content = await loadTermsDocument();
      return <article dangerouslySetInnerHTML={{ __html: content }} />;
    }

    2. Server-Side Rendering (SSR)

    SSR compiles HTML dynamically on an edge worker or Node.js server for every single incoming HTTP request. This ensures that the generated document reflects the exact millisecond-level state of user permissions, inventory, or cart data.

    Best Used For:

  • Authenticated user dashboards and account settings.
  • Real-time stock trading portals and checkout checkout flows.
  • Personalized search queries with dynamic URL filtering.
  • tsx
    export async function generateMetadata({ searchParams }: Props) {
      const query = (await searchParams).q;
      return { title: `Search results for "${query}" | Platform` };
    }

    3. Incremental Static Regeneration (ISR)

    ISR combines the speed of global CDN edge caching with the freshness of server rendering. Pages are served statically from edge cache; after a defined cache expiration window (e.g., 60 seconds), the next request triggers a background revalidation that generates updated HTML without blocking the user.

    tsx
    // Revalidate this article page at most once every hour
    export const revalidate = 3600;
    
    export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) {
      const { slug } = await params;
      const post = await fetchPostFromDatabase(slug);
      return <ArticleLayout post={post} />;
    }

    Architectural Decision Framework

    To select the right rendering strategy for each route:

    1
    Can this content be public and identical for all visitors?

    👉 Use SSG.

    2
    Does the content change periodically, but instant CDN delivery is critical?

    👉 Use ISR.

    3
    Does the page contain private user data or real-time transactional state?

    👉 Use SSR.

    By mixing these strategies on a per-route basis, you achieve optimum speed, rock-bottom infrastructure costs, and pristine user experience.