1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 16:55:50 -04:00

re-use feed.(xml,atom) logic

This commit is contained in:
2022-02-11 11:10:05 -05:00
parent bb807e0e90
commit acf39efeaa
6 changed files with 38 additions and 33 deletions

View File

@@ -36,9 +36,9 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
// make all relative URLs absolute
pages.map((page) => (page.loc = `${baseUrl}${page.loc}`));
// cache on edge for one hour
// cache on edge for 12 hours
const { res } = context;
res.setHeader("cache-control", "s-maxage=3600, stale-while-revalidate");
res.setHeader("cache-control", "s-maxage=43200, stale-while-revalidate");
// next-sitemap takes care of the rest of the response for us
return getServerSideSitemap(context, pages);