mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
15 lines
317 B
Go
15 lines
317 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
m "github.com/grafana/grafana/pkg/models"
|
||
|
macaron "gopkg.in/macaron.v1"
|
||
|
)
|
||
|
|
||
|
const HeaderNameNoBackendCache = "X-Grafana-NoCache"
|
||
|
|
||
|
func HandleNoCacheHeader() macaron.Handler {
|
||
|
return func(ctx *m.ReqContext) {
|
||
|
ctx.SkipCache = ctx.Req.Header.Get(HeaderNameNoBackendCache) == "true"
|
||
|
}
|
||
|
}
|