From 1ffec1f173cd3fc1e206e03dc34071735994a5d4 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 5 Jul 2023 13:35:21 -0600 Subject: [PATCH] feat(layer,queue): prevent browser caching for queue page --- internal/proxy/director/layer/queue/queue.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/proxy/director/layer/queue/queue.go b/internal/proxy/director/layer/queue/queue.go index c6e1d5a..9e98486 100644 --- a/internal/proxy/director/layer/queue/queue.go +++ b/internal/proxy/director/layer/queue/queue.go @@ -7,6 +7,7 @@ import ( "math/rand" "net/http" "path/filepath" + "strconv" "sync" "sync/atomic" "time" @@ -181,6 +182,8 @@ func (q *Queue) renderQueuePage(w http.ResponseWriter, r *http.Request, queueNam RefreshRate: refreshRate, } + w.Header().Add("Cache-Control", "no-cache") + w.Header().Add("Retry-After", strconv.FormatInt(int64(refreshRate.Seconds()), 10)) w.WriteHeader(http.StatusServiceUnavailable) if err := q.tmpl.ExecuteTemplate(w, "queue", templateData); err != nil {