Private
Public Access
1
0

basic cache-control headers for the dns answers api
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-07-15 20:36:45 -07:00
parent ada531e561
commit b10134b3da

View File

@@ -21,6 +21,8 @@ func (srv *Server) dnsAnswers(c echo.Context) error {
ctx := c.Request().Context()
c.Response().Header().Set("Cache-Control", "max-age=20")
conn, err := srv.chConn(ctx)
if err != nil {
slog.Error("could not connect to clickhouse", "err", err)
@@ -77,6 +79,8 @@ func (srv *Server) dnsAnswers(c echo.Context) error {
// Totals: totalData,
}
c.Response().Header().Set("Cache-Control", "max-age=1800")
return c.JSONPretty(http.StatusOK, r, "")
}