boolean

Default: true
Local
Provided by: vike-react/vike-vue/vike-solid

You need vike-react/vike-vue/vike-solid to be able to use the ssr setting. If you don't use vike-{react,vue,solid} then see Without vike-{react,vue,solid}.

Setting to enable/disable SSR (Server-Side Rendering). You can disable SSR for all your pages or only for some pages.

What is SSR? If you're unfamiliar with SSR, see:

You can disable SSR for all your pages:

// /pages/+config.ts
 
import type { Config } from 'vike/types'
 
export default {
  // Applies to all pages
  ssr: false
} satisfies Config

Or disable SSR only for some pages:

// /pages/admin-panel/+config.ts
 
import type { Config } from 'vike/types'
 
export default {
  // Applies only to all pages living under /pages/admin-panel/
  ssr: false
} satisfies Config
# Pages rendered and loaded only on the client-side
/pages/admin-panel/products/+Page.js
/pages/admin-panel/users/+Page.js
 
# Pages rendered and loaded on both client- and server-side. (Because they
# don't live under /pages/admin-panel/ thus the `ssr` setting doesn't apply.)
/pages/index/+Page.js
/pages/about/+Page.js

For better config organization, you can use a domain-driven file structure.

Alternatively, instead of using the +ssr setting, you can use the clientOnly() helper to render and load some components only on the client-side, while rendering the rest of the page with SSR.

If your goal is to remove the need for a production server, then consider pre-rendering your SSR pages instead of disabling SSR.

Without vike-{react,vue,solid}

In case you don't use a UI framework Vike extension vike-react/vike-vue/vike-solid, you can implement the ssr setting yourself.

Examples:

See also: Render Modes (SPA, SSR, SSG, HTML-only)

See also