From 7819c9ec4b00233bee53d77ce76a5f30f1f1dc5b Mon Sep 17 00:00:00 2001 From: Umputun Date: Tue, 18 Jun 2019 18:14:58 -0500 Subject: [PATCH] add keep-alive header to streamer --- backend/app/rest/api/stream.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/rest/api/stream.go b/backend/app/rest/api/stream.go index 58391e58..2968a9a1 100644 --- a/backend/app/rest/api/stream.go +++ b/backend/app/rest/api/stream.go @@ -42,6 +42,8 @@ func (s *Streamer) Activate(ctx context.Context, eventFn func() steamEventFn, w if ww, ok := w.(http.ResponseWriter); ok { ww.Header().Set("Content-Type", "text/event-stream") + ww.Header().Set("Connection", "keep-alive") + ww.Header().Set("Cache-Control", "no-cache") } for {