From 7755d63d6f1f6514ad9e9bfb0626a440baae1dcc 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 0f32dad0..c29e9e94 100644 --- a/pgs/web_asset_handler.go +++ b/pgs/web_asset_handler.go @@ -121,6 +121,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 }