diff --git a/pages/robots.txt.tsx b/pages/robots.txt.tsx index 270686e..8aaa921 100644 --- a/pages/robots.txt.tsx +++ b/pages/robots.txt.tsx @@ -13,10 +13,8 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => { } } - res.setHeader( - 'Cache-Control', - 'public, s-maxage=3600, max-age=3600, stale-while-revalidate=3600' - ) + // cache for up to one day + res.setHeader('Cache-Control', 'public, max-age=86400, immutable') res.setHeader('Content-Type', 'text/plain') // only allow the site to be crawlable on the production deployment diff --git a/pages/sitemap.xml.tsx b/pages/sitemap.xml.tsx index 0f6dce8..69684f8 100644 --- a/pages/sitemap.xml.tsx +++ b/pages/sitemap.xml.tsx @@ -16,10 +16,10 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => { const siteMaps = await getSiteMaps() - // cache for up to one hour + // cache for up to 8 hours res.setHeader( 'Cache-Control', - 'public, s-maxage=3600, max-age=3600, stale-while-revalidate=3600' + 'public, max-age=28800, stale-while-revalidate=28800' ) res.setHeader('Content-Type', 'text/xml') res.write(createSitemap(siteMaps[0]))