fix (caching): obey to the no-cache http header

This commit is contained in:
MickaelK
2025-08-30 01:57:10 +10:00
parent 1f14bd94ae
commit 6a1a6507d9

View File

@ -402,7 +402,7 @@ func ServeBundle() func(*App, http.ResponseWriter, *http.Request) {
return func(ctx *App, res http.ResponseWriter, req *http.Request) {
res.Header().Set("Content-Type", "application/javascript")
if strings.Contains(req.Header.Get("Accept-Encoding"), "br") {
if strings.Contains(req.Header.Get("Accept-Encoding"), "br") && req.Header.Get("Cache-Control") != "no-cache" {
res.Header().Set("Content-Encoding", "br")
res.Write(bundleBr)
return