diff --git a/src/pages/calls.tsx b/src/pages/calls.tsx index f5216cd..5707622 100644 --- a/src/pages/calls.tsx +++ b/src/pages/calls.tsx @@ -27,10 +27,13 @@ const Calls: NextPage = (props) => { }; export const getServerSideProps = withPageOnboardingRequired( - async (context, user) => { - return { - props: { userId: user.id, ddd: 23 as const }, - }; + async ({ res }) => { + res.setHeader( + "Cache-Control", + "private, s-maxage=15, stale-while-revalidate=59", + ); + + return { props: {} }; }, ); diff --git a/src/pages/keypad.tsx b/src/pages/keypad.tsx index 4da0249..0d09dae 100644 --- a/src/pages/keypad.tsx +++ b/src/pages/keypad.tsx @@ -50,7 +50,8 @@ const Keypad: NextPage = () => { -
+
@@ -117,6 +118,13 @@ const pressBackspaceAtom = atom( }, ); -export const getServerSideProps = withPageOnboardingRequired(); +export const getServerSideProps = withPageOnboardingRequired(({ res }) => { + res.setHeader( + "Cache-Control", + "private, s-maxage=15, stale-while-revalidate=59", + ); + + return { props: {} }; +}); export default Keypad; diff --git a/src/pages/messages/index.tsx b/src/pages/messages/index.tsx index 1c8da4d..634f562 100644 --- a/src/pages/messages/index.tsx +++ b/src/pages/messages/index.tsx @@ -49,6 +49,11 @@ type Recipient = string; export const getServerSideProps = withPageOnboardingRequired( async (context, user) => { + context.res.setHeader( + "Cache-Control", + "private, s-maxage=15, stale-while-revalidate=59", + ); + const [customer, messages] = await Promise.all([ findCustomer(user.id), findCustomerMessages(user.id), diff --git a/src/pages/settings/index.tsx b/src/pages/settings/index.tsx index c43a091..595514c 100644 --- a/src/pages/settings/index.tsx +++ b/src/pages/settings/index.tsx @@ -49,6 +49,15 @@ const Settings: NextPage = (props) => { ); }; -export const getServerSideProps = withPageOnboardingRequired(); +export const getServerSideProps = withPageOnboardingRequired( + async ({ res }) => { + res.setHeader( + "Cache-Control", + "private, s-maxage=15, stale-while-revalidate=59", + ); + + return { props: {} }; + }, +); export default Settings;