mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 04:06:58 +00:00
add a cache-control header to metadata page
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user