add a cache-control header to metadata page

This commit is contained in:
Evan Jarrett
2025-12-22 21:01:28 -06:00
parent 8d0cff63fb
commit 34c2b8b17c
+3
View File
@@ -392,6 +392,9 @@ func serveRegistry(cmd *cobra.Command, args []string) error {
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Access-Control-Allow-Origin", "*")
// Limit caching to allow scope changes to propagate quickly
// PDS servers cache client metadata, so short max-age helps with updates
w.Header().Set("Cache-Control", "public, max-age=300")
if err := json.NewEncoder(w).Encode(metadataMap); err != nil {
http.Error(w, "Failed to encode metadata", http.StatusInternalServerError)
}