Skip to content

Conflict Between SSR Deployment Guides Using Adapters (output: 'server') and the On-Demand Rendering Guide (output: 'static') #11245

Closed
@romarioputra

Description

@romarioputra

📚 Subject area/topic

SSR, Adapters, Astro Output Configuration

📋 Page(s) affected (or suggested, for new content)

https://docs.astro.build/en/guides/on-demand-rendering
https://docs.astro.build/en/guides/integrations-guide/cloudflare/
https://docs.astro.build/en/guides/integrations-guide/netlify/
https://docs.astro.build/en/guides/integrations-guide/node/
https://docs.astro.build/en/guides/integrations-guide/vercel/

📋 Description of content that is out-of-date or incorrect

Problem:

The current deployment guides for official Astro adapters (Cloudflare, Netlify, Node, and Vercel) recommend setting output: 'server' by default. However, this conflicts with the tip (and Astro's main philosophy of delivering the smallest amount of JavaScript possible) in the on-demand rendering guide, which suggests starting with output: 'static' unless most pages require SSR.

Start with the default 'static' mode until you are sure that most or all of your pages will be rendered on demand! This ensures that your site is as performant as possible, not relying on a server function to render static content.

The 'server' output mode does not bring any additional functionality. It only switches the default rendering behavior.

For example, the Cloudflare manual installation guide instructs users to configure astro.config.mjs as follows:

import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
  output: 'server',
  adapter: cloudflare(),
});

Why this is confusing:

  1. Astro’s docs recommend output: 'static' by default:

    • The [on-demand rendering guide](https://docs.astro.build/en/guides/on-demand-rendering/#server-mode) explicitly states:

      "Start with the default 'static' mode until you are sure that most or all of your pages will be rendered on demand! This ensures that your site is as performant as possible, not relying on a server function to render static content."

    • This suggests that output: 'static' should remain the starting point for most projects, yet all official adapter guides default to output: 'server'.
  2. Cloudflare Pages does not require output: 'server':

    • I confirmed with an Astro core team member in Discord that Cloudflare Pages still supports SSR even when output: 'static' is used.
  3. Granular control with prerender = false already exists:

    • The correct way to enable SSR for specific pages is via export const prerender = false, making output: 'server' unnecessary for projects that are mostly static.
  4. All official adapter guides follow this pattern:

    • Cloudflare, Netlify, Node, and Vercel all default to output: 'server', despite output: 'static' being the suggested starting point in Astro’s other documentation.

Suggestion:

  1. Clarify in adapter documentation that output: 'static' works too – Keep output: 'server' as the default in deployment guides but explicitly mention that output: 'static' is also viable with a reminder on using prerender: false for SSR pages.
  2. (Possible idea) Use output: static as the default when installing adapter, and then clarify that you need to add prerender: false for SSR pages.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions