From 51a64abe860a948545ab02e87cac105ece9f001c Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 14 May 2015 02:08:47 +0200 Subject: [PATCH] Setting "Cache-Control" to "no-cache" in SSE --- render/ssevent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/render/ssevent.go b/render/ssevent.go index bc250c6b..c9dad22f 100644 --- a/render/ssevent.go +++ b/render/ssevent.go @@ -21,6 +21,9 @@ func WriteSSEvent(w http.ResponseWriter, eventName string, data interface{}) err if len(header.Get("Content-Type")) == 0 { header.Set("Content-Type", sse.ContentType) } + if len(header.Get("Cache-Control")) == 0 { + header.Set("Cache-Control", "no-cache") + } return sse.Encode(w, sse.Event{ Event: eventName, Data: data,