From be64bf71a784e0588f60c647f808ac50dbfc174e Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 14 Jul 2022 14:57:17 -0500 Subject: [PATCH] Limit the amount of bets and comments sent to the client through getStaticProps --- web/pages/[username]/[contractSlug].tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/pages/[username]/[contractSlug].tsx b/web/pages/[username]/[contractSlug].tsx index 0cfbc99f..17453770 100644 --- a/web/pages/[username]/[contractSlug].tsx +++ b/web/pages/[username]/[contractSlug].tsx @@ -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