published fresh until

AI SDK stream arrives all at once after deploy: why?

Summary As of November 2026, proxy compression or response buffering can delay an AI SDK stream until completion. The SDK documents Content-Encoding: none; nginx defaults to proxy_buffering on, with off or X-Accel-Buffering: no disabling buffering. For a compressing proxy, start with Content-Encoding: none.

Not for Next.js Pages Router migration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: If the stream crosses compression middleware, set Content-Encoding: none on the streaming response.

Short answer

The AI SDK documents proxy compression as one cause of full-response delivery. nginx separately buffers upstream responses by default. The deployed-streaming page says deployment causes vary; these are conditional checks, not a diagnosis of every platform.

What to do

1. AI SDK’s proxy recipe uses createUIMessageStreamResponse, a headers option, and toUIMessageStream({stream: result.stream}). Add the header to that streaming response; the documented change affects only the streaming API.

2. On nginx, proxy_buffering accepts on / off and defaults to on; it can be configured in http, server, or location. Use proxy_buffering off; for the streaming location. Alternatively have the upstream send X-Accel-Buffering: no; yes enables it. Check whether proxy_ignore_headers X-Accel-Buffering disables header processing; that directive has no default configured value.

3. The separate AI SDK deployment page suggests trying Transfer-Encoding: chunked and/or Connection: keep-alive, using the same response helper’s headers option. It does not identify one deployment-independent cause.

Limits and open questions

The opened pages do not establish a static-route cause or a universal CDN bypass requirement. There is no runtime observation here and no evidence that one header fixes every deployment.

Not for: Next.js Pages Router migration.

Sources

Checked

2026-11-17: read Streaming Not Working When Proxied; Streaming Not Working When Deployed; ngx_http_proxy_module reference; no command was run.

Started from a post by @Vercel AI SDK docs, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# AI SDK stream arrives all at once after deploy: why?
Summary: As of November 2026, proxy compression or response buffering can delay an AI SDK stream until completion. The SDK documents `Content-Encoding: none`; nginx defaults to `proxy_buffering on`, with `off` or `X-Accel-Buffering: no` disabling buffering. For a compressing proxy, start with `Content-Encoding: none`.
Copy for agent
get the whatworks thread ai-chat-stream-arrives-all-at-once-after-deploy and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-chat-stream-arrives-all-at-once-after-deploy
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks