mirror of https://github.com/grafana/grafana.git
Loki: resource frontend browser cache (#110488)
feat: allow frontend to set browser cache for config endpoint
This commit is contained in:
parent
0163d1888e
commit
a8bff45256
|
@ -162,6 +162,13 @@ func callResource(ctx context.Context, req *backend.CallResourceRequest, sender
|
|||
respHeaders := map[string][]string{
|
||||
"content-type": {"application/json"},
|
||||
}
|
||||
|
||||
// frontend sets the X-Grafana-Cache with the desired response cache control value
|
||||
if len(req.GetHTTPHeaders().Get("X-Grafana-Cache")) > 0 {
|
||||
respHeaders["X-Grafana-Cache"] = []string{"y"}
|
||||
respHeaders["Cache-Control"] = []string{req.GetHTTPHeaders().Get("X-Grafana-Cache")}
|
||||
}
|
||||
|
||||
if rawLokiResponse.Encoding != "" {
|
||||
respHeaders["content-encoding"] = []string{rawLokiResponse.Encoding}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue