Skip to content

Commit

Permalink
don't cache dynamic routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Woozl committed Mar 3, 2023
1 parent 5a447d9 commit ea00a85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pages/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ const DynamicPage = ({
}

export async function getServerSideProps(context) {
context.res.setHeader(
'Cache-Control',
'no-cache, no-store, must-revalidate'
)

const { params, locale, locales, defaultLocale, preview = null } = context

const globalLocale = await getGlobalData(locale)
Expand Down

0 comments on commit ea00a85

Please sign in to comment.