mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-19 07:26:45 +00:00
🔗
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user