diff --git a/pkg/services/publicdashboards/service/query.go b/pkg/services/publicdashboards/service/query.go index bb10954a64f..a9fa2bd596b 100644 --- a/pkg/services/publicdashboards/service/query.go +++ b/pkg/services/publicdashboards/service/query.go @@ -243,6 +243,7 @@ func groupQueriesByPanelId(dashboard *simplejson.Json) map[int64][]*simplejson.J var panelQueries []*simplejson.Json + cacheTTLOverride := panel.Get("queryCachingTTL").MustInt64(0) for _, queryObj := range panel.Get("targets").MustArray() { query := simplejson.NewFromAny(queryObj) @@ -257,6 +258,10 @@ func groupQueriesByPanelId(dashboard *simplejson.Json) map[int64][]*simplejson.J query.Set("datasource", datasource) } + if cacheTTLOverride > 0 { + query.Set("queryCachingTTL", cacheTTLOverride) + } + panelQueries = append(panelQueries, query) } }