change cache control header (stale-while-revalidate)

This commit is contained in:
spencerwooo
2022-02-12 19:37:00 +08:00
parent 8d57826e00
commit a8ea73c564
5 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Set edge function caching for faster load times, check docs:
// https://vercel.com/docs/concepts/functions/edge-caching
res.setHeader('Cache-Control', 'max-age=0, s-maxage=600, stale-while-revalidate')
res.setHeader('Cache-Control', apiConfig.cacheControlHeader)
// Sometimes the path parameter is defaulted to '[...path]' which we need to handle
if (path === '[...path]') {