From 7bfeaf80451b375b5f19aa422248e28d4920a4c9 Mon Sep 17 00:00:00 2001 From: Mac Chaffee Date: Tue, 29 Oct 2024 22:43:40 -0400 Subject: [PATCH] Disable caching from proxied responses --- pgs/web_asset_handler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pgs/web_asset_handler.go b/pgs/web_asset_handler.go index 45cc68ec..800140d1 100644 --- a/pgs/web_asset_handler.go +++ b/pgs/web_asset_handler.go @@ -123,6 +123,11 @@ func (h *ApiAssetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { r.Host = destUrl.Host r.URL = destUrl } + // Disable caching + proxy.ModifyResponse = func(r *http.Response) error { + r.Header.Set("cache-control", "no-cache") + return nil + } proxy.ServeHTTP(w, r) return }