add cache-control to validPetPoses API

This commit is contained in:
Matt Dunn-Rankin 2020-05-03 02:13:46 -07:00
parent 3f2f77c35d
commit a164235c0e

View file

@ -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);
};