s3 refactoring, cache-control

This commit is contained in:
skidoodle 2022-05-02 13:21:55 +02:00
parent 7108943dc2
commit 7f3e74abd4
3 changed files with 84 additions and 96 deletions

View file

@ -20,9 +20,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return acc + curr.Size! / 1024 / 1024 / 1024
}, 0)
res.statusCode = 200
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({
res.setHeader('Cache-Control', 's-maxage=86400');
res.status(200).json (JSON.stringify({
'objectCount': data.KeyCount,
'totalSize': (Math.round(totalsize * 100) / 100)
}, null, 2))