From 92dcee725071aceccbe23e59428889452a07f03c Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 21 Apr 2023 10:28:28 +0300 Subject: [PATCH] skip Cache-Control header for the Admin UI root path --- apis/base.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apis/base.go b/apis/base.go index 6336a878..6e6b243e 100644 --- a/apis/base.go +++ b/apis/base.go @@ -203,7 +203,11 @@ func updateTotalAdminsCache(app core.App) error { func uiCacheControl() echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { - c.Response().Header().Set("Cache-Control", "max-age=1209600, stale-while-revalidate=86400") + // add default Cache-Control header for all Admin UI resources + // (ignoring the root admin path) + if c.Request().URL.Path != trailedAdminPath { + c.Response().Header().Set("Cache-Control", "max-age=1209600, stale-while-revalidate=86400") + } return next(c) }