Skip to content

Commit 4f6b1aa

Browse files
committed
add note to the user guide about stream() and eventStream()
1 parent d32f25a commit 4f6b1aa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎user_guide_src/source/outgoing/response.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ compression is turned off automatically, but if your web server or CDN
275275
compresses responses (e.g., nginx ``gzip`` or Apache ``mod_deflate``), configure
276276
it to skip your streaming endpoints - compression can delay chunk delivery.
277277

278+
.. note:: ``stream()`` and ``eventStream()`` create a new response instance.
279+
Headers, cookies, and status codes already set on the main response are not
280+
copied. Set them on the returned ``StreamResponse`` or ``SSEResponse``
281+
instance before returning it.
282+
278283
The response is streamed: output buffering is disabled, the PHP time limit is
279284
removed, and the session is closed to avoid blocking other requests. After
280285
filters still run and may set headers, but they must not rely on the response

0 commit comments

Comments
 (0)