From 9548844a7fe96da537ee5d9c89aa3f55e0b58cda Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Fri, 16 Aug 2024 11:04:20 -0400 Subject: [PATCH] feat: now the dev card page is cached for one hour --- pages/u/[username]/card.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/u/[username]/card.tsx b/pages/u/[username]/card.tsx index bd714755d..724218fc8 100644 --- a/pages/u/[username]/card.tsx +++ b/pages/u/[username]/card.tsx @@ -58,6 +58,11 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { const uniqueUsernames = [...new Set([username, ...ADDITIONAL_PROFILES_TO_LOAD])]; const cards = await Promise.all(uniqueUsernames.map(fetchUserData)); + // Cache page for one hour + context.res.setHeader("Cache-Control", "public, max-age=0, must-revalidate"); + context.res.setHeader("Netlify-CDN-Cache-Control", "public, max-age=0, stale-while-revalidate=3600"); + context.res.setHeader("Cache-Tag", `user-profiles,user-profile-${username}`); + return { props: { username,