From fb4702eb8db400a53808def3bc3a1523ac0cae5e Mon Sep 17 00:00:00 2001 From: dawn Date: Fri, 18 Sep 2026 09:05:35 +0300 Subject: [PATCH] knotmirror/xrpc: no-store by-name ref responses Signed-off-by: dawn --- knotmirror/xrpc/xrpc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/knotmirror/xrpc/xrpc.go b/knotmirror/xrpc/xrpc.go index ee304876f..ac88c1d1c 100644 --- a/knotmirror/xrpc/xrpc.go +++ b/knotmirror/xrpc/xrpc.go @@ -206,7 +206,8 @@ func setCacheControl(w http.ResponseWriter, refs ...string) { if len(refs) > 0 && lo.EveryBy(refs, func(ref string) bool { return gitutil.Rev(ref).IsObjectID() }) { w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") } else { - w.Header().Set("Cache-Control", "public, no-cache") + // ref names are mutable, no-cache here lets edge caches cache the response + w.Header().Set("Cache-Control", "private, no-store") } } -- 2.51.2