+ssr
boolean
truevike-react/vike-vue/vike-solidYou need
vike-react/vike-vue/vike-solidto be able to use thessrsetting. If you don't usevike-{react,vue,solid}then see Withoutvike-{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.js
export default {
// Applies to all pages
ssr: false
}// /pages/+config.ts
import type { Config } from 'vike/types'
export default {
// Applies to all pages
ssr: false
} satisfies ConfigOr disable SSR only for some pages:
// /pages/admin-panel/+config.js
export default {
// Applies only to all pages living under /pages/admin-panel/
ssr: false
}// /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# Pages rendered and loaded only on the client-side
/pages/admin-panel/products/+Page.ts
/pages/admin-panel/users/+Page.ts
# 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.ts
/pages/about/+Page.tsFor better config organization, you can use page groups.
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)