Skip to content

Commit

Permalink
set max-age
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasMahe committed Feb 21, 2024
1 parent 995e727 commit cc8fae8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ MyApp.getInitialProps = async (
// set cache control header
appContext.ctx.res?.setHeader(
'Cache-Control',
'public, s-maxage=20, stale-while-revalidate=20',
'public, max-age=20, s-maxage=20, stale-while-revalidate=20',
)
const jwt = appContext.ctx.req?.cookies?.[COOKIE_JWT_TOKEN] || null
// Generate the now time, rounded to the second to avoid re-rendering on the client
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MyDocument extends Document {
// set cache control header
context.res?.setHeader(
'Cache-Control',
'public, s-maxage=10, stale-while-revalidate=10',
'public, max-age=10, s-maxage=10, stale-while-revalidate=10',
)

invariant(context.req)
Expand Down

0 comments on commit cc8fae8

Please sign in to comment.