From 7be5a4ccae8cf7ce2cbc6943bd9de838e9973a06 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Sat, 27 Jun 2026 04:53:52 +0330 Subject: [PATCH] docs(Response): add PHP built-in server limitations for SSEResponse --- user_guide_src/source/outgoing/response.rst | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/user_guide_src/source/outgoing/response.rst b/user_guide_src/source/outgoing/response.rst index 042ca9c4c9f9..e0849382f1ab 100644 --- a/user_guide_src/source/outgoing/response.rst +++ b/user_guide_src/source/outgoing/response.rst @@ -266,6 +266,29 @@ use comments for keep-alive and configure the client retry interval: .. literalinclude:: response/037.php +Development Server Limitations +------------------------------ + +When testing SSE locally, keep in mind that PHP's built-in development server +(used by ``php spark serve``) is not designed to handle long-lived streaming +connections effectively. + +Because an SSE connection remains open for an extended period, the built-in +server may spend most of its capacity serving the stream. As a result, other +requests may appear slow, blocked, or delayed while the SSE connection is active. + +Possible symptoms include: + +- normal HTTP requests appearing to hang or time out +- API requests responding slowly +- frontend requests remaining in a pending state + +For more realistic testing, prefer a server stack that handles concurrent +requests better, such as Apache, Nginx with PHP-FPM, or FrankenPHP. + +This behavior is a limitation of the development server environment, not of +``SSEResponse`` itself. + Production Considerations -------------------------