Skip to content

Commit e6f39f2

Browse files
committed
dns queries: set cache-control header
1 parent 962839e commit e6f39f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

chdb/geoqueries.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (d *ClickHouse) DNSQueries(ctx context.Context) ([]DNSQueryCounts, error) {
197197
ctx, span := tracing.Tracer().Start(ctx, "DNSQueries")
198198
defer span.End()
199199

200-
startUnix := time.Now().Add(-90 * time.Minute).Unix()
200+
startUnix := time.Now().Add(2 * time.Hour * -1).Unix()
201201
startUnix -= startUnix % (60 * 5)
202202

203203
log.InfoContext(ctx, "start time", "start", startUnix)

server/server.go

+3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ func (srv *Server) dnsQueryCounts(c echo.Context) error {
288288
return c.String(http.StatusInternalServerError, err.Error())
289289
}
290290

291+
hdr := c.Response().Header()
292+
hdr.Set("Cache-Control", "s-maxage=30,max-age=60")
293+
291294
return c.JSON(http.StatusOK, data)
292295
}
293296

0 commit comments

Comments
 (0)