+cache control

This commit is contained in:
skidoodle 2022-05-30 22:49:22 +02:00 committed by GitHub
parent a8c83cd8f4
commit decf5c8cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,5 +39,6 @@ export default async function(req: NextApiRequest, res: NextApiResponse) {
startAfter = data.Contents!.slice(-1)[0].Key; startAfter = data.Contents!.slice(-1)[0].Key;
} }
} }
res.setHeader('Cache-Control', 'public, s-maxage=10, stale-while-revalidate=59');
res.json({ object: objects, size: Number(size.toFixed(2)) }) res.json({ object: objects, size: Number(size.toFixed(2)) })
} }