Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Nuxt 4.5’s experimental SSR streaming is off by default. After enabling it with experimental: { ssrStreaming: true }, you can keep selected routes buffered by setting streaming: false in routeRules. For a decision that depends on each request—for example, a cookie or authentication state—use the render:route hook instead.

Disable streaming for a route or route pattern

Add streaming: false to the matching route rule. The example below enables streaming globally, then opts out the /no-stream/ path and its descendants:

export default defineNuxtConfig({
  experimental: { ssrStreaming: true },
  routeRules: {
    '/no-stream/**': { streaming: false },
  },
})

Use this approach when the same URL pattern should always use buffered rendering. Nuxt 4.5 marks SSR streaming as experimental and disables it by default; the route rule is an opt-out, not a requirement to enable streaming. See the Nuxt 4.5 release announcement and the Nuxt Advanced v4 experimental-features guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between route rules and request-time control

Control Scope Decision basis Where to configure it
routeRules with streaming: false A stable route or route pattern The configured URL pattern nuxt.config.ts
render:route with ctx.prefersStream = false An individual request Request-specific state, such as cookies, authentication, or an A/B bucket A Nuxt hook that runs before rendering

For dynamic decisions, Nuxt documents checking ctx.canStream in the render:route hook and setting ctx.prefersStream = false when that request should use buffered rendering. The hook runs before rendering, so it is the appropriate control point for request-dependent choices. Consult the experimental-features guide for the documented hook behavior.

Know when Nuxt bypasses streaming automatically

Setting streaming: false is the explicit route-level opt-out. It is not the only reason a response may be buffered or short-circuited. Nuxt’s guide lists these conditions:

  • A route rule sets noScripts, cache, isr, swr, or redirect, or sets streaming: false.
  • The route uses ssr: false.
  • The request has a bot or crawler user agent. Nuxt excludes bots by default so they receive fully rendered HTML. The bot-matching pattern can be changed with experimental.ssrStreaming.botRegex; the default intentionally excludes Lighthouse and other audit tools.
  • The route has been prerendered.
  • A server-side navigateTo() redirects from a plugin, middleware, or page setup.
  • A fatal error occurs before the shell is flushed.

These behaviors are described in Nuxt’s experimental-features guide. A route that does not stream may therefore be following a built-in fallback rather than a rule you added.

Understand the cost of the first flush

With streaming enabled, Nuxt can send the HTML shell—including the head, styles, preload hints, and entry scripts—before it has finished sending rendered body content. Once that first portion is sent, the response status and headers are committed. A status, header, or cookie change attempted later during component rendering cannot reliably reach the client. Nuxt describes this as inherent to streaming, not a Nuxt-specific bug.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nuxt says mutations completed by Nuxt and Nitro plugins before rendering can be sent. By contrast, mutations during component rendering may be too late, including setResponseStatus(), useResponseHeader(), cookie writes through useCookie(), and h3 header operations. Move such work to a plugin before rendering when appropriate, or disable streaming for the route. In development, Nuxt logs a warning identifying dropped mutations and the route. Details are in the Nuxt guide.

Module authors: distinguish pre-flush and streamed body hooks

Nuxt’s render:html hook runs before the shell flush. Changes to htmlAttrs, head, bodyAttrs, and bodyPrepend can affect the response. Changes to body or bodyAppend are dropped because the body is about to stream. Treat the flush boundary as a functional constraint when a module depends on modifying the final HTML.

Check CSS and island behavior before rollout

Nuxt documents that route styles arrive after the shell. Styles for the page, layout, and directly nested async components can be available before body paint; styles from an async component nested inside another async component may arrive with the closing HTML, after that component’s DOM. For paint-critical styling, the guide recommends global CSS, utility CSS in the entry stylesheet, or keeping the async component directly under a <Suspense> boundary. If that does not fit the route, use the route-level opt-out.

Production builds extract styles to CSS files or inline them, so development rendering alone does not establish production behavior. Nuxt recommends validating visuals with nuxt build && nuxt preview. Island slot content and selective-client components use inert templates and an inline relocation script; apps using features.noScripts with island components fall back to buffered rendering. These caveats are documented in the experimental-features guide.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate the route and response before broad use

  1. Enable streaming only if you want it globally: add experimental: { ssrStreaming: true } to nuxt.config.ts.
  2. Add streaming: false to each stable route pattern that needs buffered rendering, or use render:route for request-dependent decisions.
  3. Check whether another documented fallback—such as ssr: false, caching rules, bot detection, prerendering, or a redirect—already prevents streaming on the route.
  4. Run nuxt build && nuxt preview and inspect the production response and visual rendering, especially where headers, cookies, or async-component styles matter.

The Nuxt sources describe a qualitative potential TTFB improvement but publish no numerical benchmark for this feature. Evaluate it against your application’s response behavior rather than assuming a particular speed gain.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.