Skip to content

Commit

Permalink
quick fix for supabase cost
Browse files Browse the repository at this point in the history
  • Loading branch information
mimecuvalo committed Sep 1, 2024
1 parent a054e70 commit 56b4c92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ export const getServerSideProps: GetServerSideProps = async ({ params, req, res
};
}

res.setHeader('Cache-Control', 'public, s-maxage=10, stale-while-revalidate=3600');
// XXX: staunch bleeding for now for supabase overuse. one month caching.
const oneMonth = 60 * 60 * 24 * 30;
res.setHeader('Cache-Control', `public, s-maxage=${oneMonth}`);
// res.setHeader('Cache-Control', 'public, s-maxage=10, stale-while-revalidate=3600');

return addApolloState(client, {
props: { username, name, host },
Expand Down

0 comments on commit 56b4c92

Please sign in to comment.