diff --git a/pages/api/users/[userId]/index.js b/pages/api/users/[userId]/index.js index 0495666..424ab12 100644 --- a/pages/api/users/[userId]/index.js +++ b/pages/api/users/[userId]/index.js @@ -6,8 +6,11 @@ const handler = nc(); handler.use(all); +const maxAge = 4 * 60 * 60; // 4 hours + handler.get(async (req, res) => { const user = await getUser(req, req.query.userId); + res.setHeader('cache-control', `public, max-age=${maxAge}`); res.send({ user }); });