Skip to content

Commit

Permalink
add cache-control header to all GSSPs
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Apr 25, 2024
1 parent f6180bb commit b124b71
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ssr-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const composeNextGSSP = (...fns: IncomingGSSP[]) =>
withIronSessionSsr(async (ctx: GetServerSidePropsContext): Promise<
GetServerSidePropsResult<Record<string, unknown>>
> => {
ctx.res.setHeader('Cache-Control', 'max-age=3600, stale-while-revaluate=86400');
fns.push(injectNonce);
fns.push(updateUserStateSSR);
api.setUserData(ctx.req.session.token);
Expand Down

0 comments on commit b124b71

Please sign in to comment.