Skip to content

Commit

Permalink
Disable caching from proxied responses
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-chaffee committed Nov 16, 2024
1 parent 121bbd5 commit 7bfeaf8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pgs/web_asset_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7bfeaf8

Please sign in to comment.