Limit the amount of bets and comments sent to the client through getStaticProps

This commit is contained in:
James Grugett 2022-07-14 14:57:17 -05:00
parent d9279e42cc
commit be64bf71a7

View File

@ -65,8 +65,9 @@ export async function getStaticPropz(props: {
contract,
username,
slug: contractSlug,
bets,
comments,
// Limit the data sent to the client. Client will still load all bets and comments directly.
bets: bets.slice(0, 5000),
comments: comments.slice(0, 1000),
},
revalidate: 60, // regenerate after a minute