From 950720250732dfb4b7ca91395b7b8ed07a423dc7 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Sat, 6 Feb 2021 00:40:21 -0500 Subject: [PATCH] =?UTF-8?q?=E2=99=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/robots.txt.ts | 1 + api/sitemap.xml.ts | 1 + 2 files changed, 2 insertions(+) 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'