# The SSE interface is not functioning properly

**URL:** <https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147>\
**Category:** Dash Python\
**Created:** [January 19, 2026, 1:53am UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147 "2026-01-19T01:53:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CNFeffery](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@CNFeffery](https://community.plotly.com/u/CNFeffery)\
**Post date:** [January 19, 2026, 1:53am UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/1 "2026-01-19T01:53:03Z")

</div>

When developing a Server-Sent Events (SSE) service based on the built-in `Flask` in a `Dash` application, running it locally allows normal access to the corresponding SSE interface for streaming data return:  
 ![demo](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/f/7/f7999d794355a2fd9f7be0bddcdd966c19011b0f.gif)

However, after the same application is published to `Plotly Cloud`, the corresponding application and interface access encounter abnormalities:

- Example application: [https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app](https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app)
- Corresponding SSE interface: [Waking up the app...](https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app/stream)

Due to issues in this regard, it is impossible to deploy LLM applications that rely on streaming responses.

* * *

Example application code:

```python
import time
import json
import dash
from dash import html
from flask import Response

app = dash.Dash( __name__ )

@app.server.route("/stream")
def stream():
    def _stream():
        for i in range(999):
            time.sleep(1)
            yield "data: {}\n\n".format(json.dumps({"timestamp": time.time()}))

    return Response(_stream(), mimetype="text/event-stream")

app.layout = html.Div(
    ["SSE Example: ", html.A("/stream", href="/stream")], style={"padding": 50}
)

if __name__ == " __main__":
    app.run(debug=True)

```

---

<div class="post-metadata">

**Author:** ![Datenschubse](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@Datenschubse](https://community.plotly.com/u/Datenschubse)\
**Post date:** [January 19, 2026, 4:03pm UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/2 "2026-01-19T16:03:33Z")

</div>

Hi @CNFeffery!

Try updating the response header:

```python
response.headers.update({
                "Content-Type": "text/event-stream",
                "Cache-Control": "no-cache",
                "Transfer-Encoding": "chunked",
            })

```

So the proxy knows how deal with the stream.

---

<div class="post-metadata">

**Author:** ![CNFeffery](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@CNFeffery](https://community.plotly.com/u/CNFeffery)\
**Post date:** [January 19, 2026, 4:35pm UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/3 "2026-01-19T16:35:00Z")

</div>

I updated the application to the following code, but it still doesn’t work. It might be related to the existing mechanisms of the `Plotly Cloud` platform:

[https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app](https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app)

```python
import time
import json
import dash
from dash import html
from flask import Response

app = dash.Dash( __name__ )

@app.server.route("/stream")
def stream():
    def _stream():
        for i in range(999):
            time.sleep(1)
            yield "data: {}\n\n".format(json.dumps({"timestamp": time.time()}))

    response = Response(_stream(), mimetype="text/event-stream")
    response.headers.update(
        {
            "Content-Type": "text/event-stream",
            "Cache-Control": "no-cache",
            "Transfer-Encoding": "chunked",
        }
    )

    return response

app.layout = html.Div(
    ["SSE Example: ", html.A("/stream", href="/stream")], style={"padding": 50}
)

if __name__ == " __main__":
    app.run(debug=True)

```

---

<div class="post-metadata">

**Author:** ![nathandrezner](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nathandrezner/32/23874_2.png) [@nathandrezner](https://community.plotly.com/u/nathandrezner)\
**Post date:** [January 20, 2026, 4:48pm UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/4 "2026-01-20T16:48:18Z")

</div>

@CNFeffery I’ll have the team take a look!

---

<div class="post-metadata">

**Author:** ![CNFeffery](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@CNFeffery](https://community.plotly.com/u/CNFeffery)\
**Post date:** [January 28, 2026, 2:25pm UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/5 "2026-01-28T14:25:39Z")

</div>

I just found that the sse interface can communicate normally. Thank you very much​👍

---

<div class="post-metadata">

**Author:** ![CNFeffery](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@CNFeffery](https://community.plotly.com/u/CNFeffery)\
**Post date:** [January 28, 2026, 2:26pm UTC](https://community.plotly.com/t/the-sse-interface-is-not-functioning-properly/96147/6 "2026-01-28T14:26:41Z")

</div>

Currently, in `Plotly Cloud`, the interfaces such as the one I gave an example of earlier can be accessed normally: [Waking up the app...](https://2c55246f-8a50-49b8-87d3-048924564831.plotly.app/stream)
