diff --git a/packages/grafana-runtime/src/config.ts b/packages/grafana-runtime/src/config.ts index 343e638fb03..41211ec9abb 100644 --- a/packages/grafana-runtime/src/config.ts +++ b/packages/grafana-runtime/src/config.ts @@ -183,6 +183,7 @@ export class GrafanaBootConfig { }; caching = { enabled: false, + cleanCacheEnabled: true, }; geomapDefaultBaseLayerConfig?: MapLayerOptions; geomapDisableCustomBaseLayer?: boolean; diff --git a/pkg/api/dtos/frontend_settings.go b/pkg/api/dtos/frontend_settings.go index d550d6c88f9..f846e25795c 100644 --- a/pkg/api/dtos/frontend_settings.go +++ b/pkg/api/dtos/frontend_settings.go @@ -78,7 +78,8 @@ type FrontendSettingsAzureDTO struct { } type FrontendSettingsCachingDTO struct { - Enabled bool `json:"enabled"` + Enabled bool `json:"enabled"` + CleanCacheEnabled bool `json:"cleanCacheEnabled"` } type FrontendSettingsRecordedQueriesDTO struct { diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index 6d93ba00938..f3401ca2180 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -323,7 +323,8 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro }, Caching: dtos.FrontendSettingsCachingDTO{ - Enabled: hs.Cfg.SectionWithEnvOverrides("caching").Key("enabled").MustBool(true), + Enabled: hs.Cfg.SectionWithEnvOverrides("caching").Key("enabled").MustBool(true), + CleanCacheEnabled: hs.Cfg.SectionWithEnvOverrides("caching").Key("clean_cache_enabled").MustBool(true), }, RecordedQueries: dtos.FrontendSettingsRecordedQueriesDTO{ Enabled: hs.Cfg.SectionWithEnvOverrides("recorded_queries").Key("enabled").MustBool(true),