From f8e6b23d5f4a78f8821cec6fdedd400e629af97e Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 28 Jul 2023 11:02:59 +0200 Subject: [PATCH] Fix cache header for web and theme assets --- changelog/unreleased/fix-cache-header.md | 5 +++++ services/web/pkg/service/v0/service.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-cache-header.md diff --git a/changelog/unreleased/fix-cache-header.md b/changelog/unreleased/fix-cache-header.md new file mode 100644 index 0000000000..5fa4fa0eba --- /dev/null +++ b/changelog/unreleased/fix-cache-header.md @@ -0,0 +1,5 @@ +Bugfix: Let clients cache web and theme assets + +We needed to remove "must-revalidate" from the cache-control header to allow clients to cache the web and theme assets. + +https://github.com/owncloud/ocis/pull/6914 diff --git a/services/web/pkg/service/v0/service.go b/services/web/pkg/service/v0/service.go index 7e557b3574..3919ca4c6a 100644 --- a/services/web/pkg/service/v0/service.go +++ b/services/web/pkg/service/v0/service.go @@ -168,7 +168,7 @@ func (p Web) Static(ttl int) http.HandlerFunc { return } - w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%s, must-revalidate", strconv.Itoa(ttl))) + w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%s", strconv.Itoa(ttl))) w.Header().Set("Expires", expires) w.Header().Set("Last-Modified", lastModified) w.Header().Set("SameSite", "Strict")