skip Cache-Control header for the Admin UI root path
This commit is contained in:
parent
bd2521b14b
commit
92dcee7250
|
@ -203,7 +203,11 @@ func updateTotalAdminsCache(app core.App) error {
|
||||||
func uiCacheControl() echo.MiddlewareFunc {
|
func uiCacheControl() echo.MiddlewareFunc {
|
||||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
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)
|
return next(c)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue