api: add no cache headers for IE11

Adds pragma and expires headers for API calls so that IE11 does not
cache GET calls. Ref #5356
This commit is contained in:
Daniel Lee
2017-07-06 18:56:22 +02:00
parent fe3bcd3678
commit e6f9546a7c
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -250,6 +250,8 @@ func AddDefaultResponseHeaders() macaron.Handler {
return func(ctx *Context) {
if ctx.IsApiRequest() && ctx.Req.Method == "GET" {
ctx.Resp.Header().Add("Cache-Control", "no-cache")
ctx.Resp.Header().Add("Pragma", "no-cache")
ctx.Resp.Header().Add("Expires", "-1")
}
}
}