Make sure cache is disabled for badges and charts

This commit is contained in:
TwiN
2021-11-24 18:36:31 -05:00
parent 1f8fd29dad
commit 0331c18401
2 changed files with 9 additions and 8 deletions

View File

@ -112,6 +112,9 @@ func ResponseTimeChart(writer http.ResponseWriter, r *http.Request) {
Series: []chart.Series{series},
}
writer.Header().Set("Content-Type", "image/svg+xml")
writer.Header().Set("Cache-Control", "no-cache, no-store")
writer.Header().Set("Expires", "0")
writer.WriteHeader(http.StatusOK)
if err := graph.Render(chart.SVG, writer); err != nil {
log.Println("[handler][ResponseTimeChart] Failed to render response time chart:", err.Error())
return