From 0249dc503456203d9df01fc85bc65ed563c7f4cd Mon Sep 17 00:00:00 2001 From: Richard Kettelerij Date: Mon, 30 Sep 2024 10:34:01 +0200 Subject: [PATCH 1/2] fix(http): Add Vary header to allow clients to take content negotiation into account when caching. --- internal/controller/ogcapi_controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/controller/ogcapi_controller.go b/internal/controller/ogcapi_controller.go index 2fd4fc0..9df509f 100644 --- a/internal/controller/ogcapi_controller.go +++ b/internal/controller/ogcapi_controller.go @@ -555,6 +555,7 @@ func (r *OGCAPIReconciler) mutateHeadersMiddleware(obj metav1.Object, middleware // Other headers CustomResponseHeaders: map[string]string{ "Cache-Control": "public, max-age=3600, no-transform", + "Vary": "Accept", }, }, } From 1d6354c028e143feb0263b4865582d112cb77aa0 Mon Sep 17 00:00:00 2001 From: Richard Kettelerij Date: Mon, 30 Sep 2024 10:58:11 +0200 Subject: [PATCH 2/2] fix(http): Add Vary header to allow clients to take content negotiation into account when caching. --- internal/controller/ogcapi_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/ogcapi_controller.go b/internal/controller/ogcapi_controller.go index 9df509f..cad8cec 100644 --- a/internal/controller/ogcapi_controller.go +++ b/internal/controller/ogcapi_controller.go @@ -555,7 +555,7 @@ func (r *OGCAPIReconciler) mutateHeadersMiddleware(obj metav1.Object, middleware // Other headers CustomResponseHeaders: map[string]string{ "Cache-Control": "public, max-age=3600, no-transform", - "Vary": "Accept", + "Vary": "Accept, Accept-Encoding", }, }, }