From 67cd992e12c2cd44ec18a63fc36bc8a259b70c9b Mon Sep 17 00:00:00 2001 From: DarthSim Date: Sun, 11 Dec 2022 19:03:04 +0600 Subject: [PATCH] Set cache-control: no-cache to heath response --- CHANGELOG.md | 3 ++- server.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5917ed6a..99e66cad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ ### Change - Change `IMGPROXY_FORMAT_QUALITY` default value to `avif=65`. - Change `IMGPROXY_AVIF_SPEED` default value to `8`. -- Change `IMGPROXY_PREFERRED_FORMATS` default value to `jpeg,png,gif`; +- Change `IMGPROXY_PREFERRED_FORMATS` default value to `jpeg,png,gif`. +- Set `Cache-Control: no-cache` header to the health check responses. ## [3.11.0] - 2022-11-17 ### Add diff --git a/server.go b/server.go index 8ce5e574..402d5fc9 100644 --- a/server.go +++ b/server.go @@ -166,6 +166,7 @@ func withPanicHandler(h router.RouteHandler) router.RouteHandler { func handleHealth(reqID string, rw http.ResponseWriter, r *http.Request) { router.LogResponse(reqID, r, 200, nil) + rw.Header().Set("Cache-Control", "no-cache") rw.WriteHeader(200) rw.Write(imgproxyIsRunningMsg) }