Skip to content

Commit 92cdef0

Browse files
committed
[blobserve] enable long term caching only on success
1 parent 2f32954 commit 92cdef0

File tree

1 file changed

+3
-1
lines changed
  • components/ws-proxy/pkg/proxy

1 file changed

+3
-1
lines changed

components/ws-proxy/pkg/proxy/pass.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ func createDefaultTransport(config *TransportConfig) *http.Transport {
193193
func withLongTermCaching() proxyPassOpt {
194194
return func(cfg *proxyPassConfig) {
195195
cfg.appendResponseHandler(func(resp *http.Response, req *http.Request) error {
196-
resp.Header.Set("Cache-Control", "public, max-age=31536000")
196+
if resp.StatusCode < http.StatusBadRequest {
197+
resp.Header.Set("Cache-Control", "public, max-age=31536000")
198+
}
197199
return nil
198200
})
199201
}

0 commit comments

Comments
 (0)