basic cache-control headers for the dns answers api
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -21,6 +21,8 @@ func (srv *Server) dnsAnswers(c echo.Context) error {
|
|||||||
|
|
||||||
ctx := c.Request().Context()
|
ctx := c.Request().Context()
|
||||||
|
|
||||||
|
c.Response().Header().Set("Cache-Control", "max-age=20")
|
||||||
|
|
||||||
conn, err := srv.chConn(ctx)
|
conn, err := srv.chConn(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("could not connect to clickhouse", "err", err)
|
slog.Error("could not connect to clickhouse", "err", err)
|
||||||
@@ -77,6 +79,8 @@ func (srv *Server) dnsAnswers(c echo.Context) error {
|
|||||||
// Totals: totalData,
|
// Totals: totalData,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.Response().Header().Set("Cache-Control", "max-age=1800")
|
||||||
|
|
||||||
return c.JSONPretty(http.StatusOK, r, "")
|
return c.JSONPretty(http.StatusOK, r, "")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user