SSE custom headers #3

This commit is contained in:
Ian Renton
2025-12-24 09:44:55 +00:00
parent 2fead92dc5
commit bcc40d1416
2 changed files with 10 additions and 0 deletions

View File

@@ -53,6 +53,11 @@ class APIAlertsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
self.sse_alert_queues = sse_alert_queues
self.web_server_metrics = web_server_metrics
# Custom headers to avoid e.g. nginx reverse proxy from buffering SSE data
def custom_headers(self):
return {"Cache-Control": "no-store",
"X-Accel-Buffering": "no"}
def open(self):
try:
# Metrics