From a164235c0e2377b07531814c0a94f82901c71008 Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Sun, 3 May 2020 02:13:46 -0700 Subject: [PATCH] add cache-control to validPetPoses API --- api/validPetPoses.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/validPetPoses.js b/api/validPetPoses.js index 027caea..dba5f1c 100644 --- a/api/validPetPoses.js +++ b/api/validPetPoses.js @@ -2,5 +2,10 @@ import getValidPetPoses from "../src/server/getValidPetPoses"; export default async (req, res) => { const buffer = await getValidPetPoses(); + + // Cache for 1 hour. This will also cache at Vercel's CDN, so the function + // shouldn't even get run very often at all! + res.setHeader("Cache-Control", "max-age=3600"); + res.status(200).send(buffer); };