better cache-control

This commit is contained in:
skidoodle 2022-05-02 13:28:38 +02:00
parent e264447e50
commit 5b21368d7c

View file

@ -19,7 +19,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return acc + curr.Size! / 1024 / 1024 / 1024 return acc + curr.Size! / 1024 / 1024 / 1024
}, 0) }, 0)
res.setHeader('Cache-Control', 's-maxage=86400'); res.setHeader(
'Cache-Control',
'public, s-maxage=10, stale-while-revalidate=59'
)
res.status(200).json (JSON.stringify({ res.status(200).json (JSON.stringify({
'objectCount': data.KeyCount, 'objectCount': data.KeyCount,
'totalSize': (Math.round(totalsize * 100) / 100) 'totalSize': (Math.round(totalsize * 100) / 100)