dns queries: set cache-control header
This commit is contained in:
@@ -197,7 +197,7 @@ func (d *ClickHouse) DNSQueries(ctx context.Context) ([]DNSQueryCounts, error) {
|
||||
ctx, span := tracing.Tracer().Start(ctx, "DNSQueries")
|
||||
defer span.End()
|
||||
|
||||
startUnix := time.Now().Add(-90 * time.Minute).Unix()
|
||||
startUnix := time.Now().Add(2 * time.Hour * -1).Unix()
|
||||
startUnix -= startUnix % (60 * 5)
|
||||
|
||||
log.InfoContext(ctx, "start time", "start", startUnix)
|
||||
|
||||
@@ -288,6 +288,9 @@ func (srv *Server) dnsQueryCounts(c echo.Context) error {
|
||||
return c.String(http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
|
||||
hdr := c.Response().Header()
|
||||
hdr.Set("Cache-Control", "s-maxage=30,max-age=60")
|
||||
|
||||
return c.JSON(http.StatusOK, data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user