This commit is contained in:
Travis Fischer
2022-03-27 07:00:41 -04:00
parent ff38efcc84
commit eb302a53fd
2 changed files with 4 additions and 6 deletions

View File

@@ -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

View File

@@ -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]))