diff --git a/api/robots.txt.ts b/api/robots.txt.ts index b8115f8..e65d14c 100644 --- a/api/robots.txt.ts +++ b/api/robots.txt.ts @@ -10,6 +10,7 @@ export default async ( return res.status(405).send({ error: 'method not allowed' }) } + // cache robots.txt for up to 60 seconds res.setHeader( 'Cache-Control', 'public, s-maxage=60, max-age=60, stale-while-revalidate=60' diff --git a/api/sitemap.xml.ts b/api/sitemap.xml.ts index 29b942a..f591ed8 100644 --- a/api/sitemap.xml.ts +++ b/api/sitemap.xml.ts @@ -14,6 +14,7 @@ export default async ( const siteMaps = await getSiteMaps() + // cache sitemap for up to one hour res.setHeader( 'Cache-Control', 'public, s-maxage=3600, max-age=3600, stale-while-revalidate=3600'