Skip to content

Commit

Permalink
fix: now the page is cached varying on the day range (#3310)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed May 3, 2024
1 parent 1268d7b commit b6a46cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pages/s/[org]/[repo]/index.tsx
Expand Up @@ -55,6 +55,8 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {

// Cache for two hours
context.res.setHeader("Netlify-CDN-Cache-Control", "public, max-age=0, stale-while-revalidate=7200");
context.res.setHeader("Netlify-Vary", "query=range");
context.res.setHeader("Cache-Tag", `repo-pages,repo-page-${repoData.id}`);

return { props: { repoData, ogImageUrl } };
}
Expand Down

0 comments on commit b6a46cf

Please sign in to comment.